Created
April 16, 2020 16:51
-
-
Save bhaskar253/8e8e07e9cb3fa465cbca6e55226f9f36 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 2.8.12) | |
| project(YOUR_PROJECT) | |
| # Enable multithreaded compilation in MSVC | |
| if (MSVC) | |
| add_definitions(/MP) | |
| endif() | |
| # Rewrite to a nicer output directory. Can be removed | |
| set(ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/output) | |
| set(LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/output) | |
| set(RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/output) | |
| # Include Paths | |
| include_directories("${PROJECT_SOURCE_DIR}/include/PATH") | |
| # Add fiiles to src | |
| file(GLOB src | |
| "${PROJECT_SOURCE_DIR}/src/*.h" | |
| "${PROJECT_SOURCE_DIR}/src/*.cpp" | |
| "${PROJECT_SOURCE_DIR}/src/*.c" | |
| "${PROJECT_SOURCE_DIR}/src/ADDITIONAL/PATHS/..." | |
| ) | |
| # default flags to true | |
| option(YOUR_PROJECT_EXECUTABLE "BUILD EXECUTABLE" ON) | |
| if (YOUR_PROJECT_EXECUTABLE) | |
| add_executable(your_project ${vm_src}) | |
| target_link_libraries(your_project ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${ST_CXXFS_LIBS}) | |
| target_include_directories(your_project PUBLIC ${PROJECT_SOURCE_DIR}/src) | |
| endif () |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment