Ejemplo n.º 1
0
def create_src_main(location: WorkspaceLocation):
    static_content = "#include <iostream> \n\n" \
                     "int main() \n" \
                     "{ \n" \
                     "\tstd::cout << \"Hello, World!\" << std::endl; \n" \
                     "\treturn 0;\n" \
                     "}\n"
    with open(os.path.join(location.get_src_path(), "main.cpp"), 'w') as file:
        file.write(static_content)
Ejemplo n.º 2
0
def create_src_cmakelists(location: WorkspaceLocation):
    static_content = "cmake_minimum_required(VERSION 3.17) \n" \
                     "set(BINARY ${CMAKE_PROJECT_NAME}) \n" \
                     "file(GLOB_RECURSE SOURCES LIST_DIRECTORIES true *.h *.cpp) \n" \
                     "set(SOURCES ${SOURCES}) \n" \
                     "add_executable(${BINARY}_run ${SOURCES}) \n" \
                     "add_library(${BINARY}_lib STATIC ${SOURCES})\n"

    with open(os.path.join(location.get_src_path(), "CMakeLists.txt"),
              'w') as file:
        file.write(static_content)
Ejemplo n.º 3
0
def create_dir_structure(workspace: WorkspaceLocation):
    os.mkdir(workspace.get_src_path())
    os.mkdir(workspace.get_unit_test_path())