Skip to content

Instantly share code, notes, and snippets.

@yuya-oc
Created April 12, 2012 12:49
Show Gist options
  • Save yuya-oc/2367010 to your computer and use it in GitHub Desktop.
Save yuya-oc/2367010 to your computer and use it in GitHub Desktop.
Using Boost with CMake
find_package(Boost COMPONENTS program_options thread REQUIRED)
if(Boost_FOUND)
message("Boost is found:")
message(" Boost_INCLUDE_DIRS= ${Boost_INCLUDE_DIRS}")
message(" Boost_LIBRARIES= ${Boost_LIBRARIES}")
message(" Boost_LIBRARY_DIRS= ${Boost_LIBRARY_DIRS}")
include_directories(${Boost_INCLUDE_DIRS})
add_definitions("-DHAS_BOOST")
endif()
add_executable(foo
main.cpp
)
target_link_libraries(foo ${Boost_LIBRARIES})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment