Skip to content

Instantly share code, notes, and snippets.

@eduardoaugustojulio
Created August 1, 2017 01:13
Show Gist options
  • Save eduardoaugustojulio/2287c23cf853bdeab4bd7032f191833d to your computer and use it in GitHub Desktop.
Save eduardoaugustojulio/2287c23cf853bdeab4bd7032f191833d to your computer and use it in GitHub Desktop.
cmake template with c++11 and boost support
cmake_minimum_required(VERSION 2.8)
project(project CXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(Boost 1.40.0 COMPONENTS filesystem system REQUIRED)
file(GLOB SOURCE_FILES src/*.cpp)
add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
@eduardoaugustojulio
Copy link
Author

eduardoaugustojulio commented Aug 1, 2017

Folder organization

.
├── bin
├── build
├── CMakeLists.txt
└── src

To build, run inside folder the following command
~/project/build/$cmake ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment