Created
October 12, 2012 18:09
-
-
Save philip-goh/3880608 to your computer and use it in GitHub Desktop.
A basic cmake template that creates a minimal project
This file contains 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.6) | |
#Create an executable called Minimal that depends on minimal.cpp. Additional source files | |
#should be space separated. | |
add_executable(Minimal minimal.cpp) | |
project(Minimal) | |
#Tell the compiler to link to the static runtime | |
add_definitions(-static) | |
#Define preprocessor macro to get boost::threads working on Windows | |
add_definitions(-DBOOST_THREAD_USE_LIB) | |
#Look for the Boost package. If CMake fails to find Boost, it's very likely that you | |
#have not set the CMAKE_PREFIX_PATH environment variable. | |
find_package(Boost COMPONENTS thread system filesystem REQUIRED) | |
include_directories(${Boost_INCLUDE_DIRS}) | |
target_link_libraries(Minimal ${Boost_LIBRARIES}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment