#!/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 "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 int main(int argc, char *argv[]) { std::cout << "Hello, world!" << std::endl; } """)