4 changed files with 110 additions and 7 deletions
@ -0,0 +1,11 @@
|
||||
cmake_minimum_required (VERSION 2.8.4) |
||||
set(project_name newtestproject) |
||||
project (${project_name}) |
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
||||
|
||||
INCLUDE(FindPkgConfig) |
||||
|
||||
add_executable(main |
||||
main.cpp |
||||
) |
||||
|
||||
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/python |
||||
#snippet plugin |
||||
import juci_to_python_api as juci, inspect |
||||
import sys, os |
||||
|
||||
def initPlugin(): |
||||
juci.addMenuElement("CreateProject") |
||||
juci.addSubMenuElement("CreateProjectMenu", #name of parent menu |
||||
"Create new project", #menu description |
||||
"newProject()", #function to execute |
||||
inspect.getfile(inspect.currentframe()), #plugin path |
||||
"<control><alt>p") |
||||
|
||||
def newProject(): |
||||
path='../Projects/newtestProject/' |
||||
if not os.path.exists(path): |
||||
os.makedirs(path) |
||||
cmake=path+'CMakeLists.txt' |
||||
main=path+'main.cpp' |
||||
|
||||
|
||||
|
||||
cmakefile = open(cmake, 'w') |
||||
|
||||
cmakefile.write("""\ |
||||
cmake_minimum_required (VERSION 2.8.4) |
||||
set(project_name newtestproject) |
||||
project (${project_name}) |
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
||||
|
||||
INCLUDE(FindPkgConfig) |
||||
|
||||
add_executable(main |
||||
main.cpp |
||||
) |
||||
""") |
||||
|
||||
mainfile = open(main, 'w') |
||||
|
||||
mainfile.write("""\ |
||||
#include <iostream> |
||||
|
||||
int main(int argc, char *argv[]) { |
||||
std::cout << "Hello, world!" << std::endl; |
||||
} |
||||
""") |
||||
|
||||
Loading…
Reference in new issue