I want to define a minimum boost version to be available on the system. I tried the following approach. Unfortunately this did not work, as it tries to compile also with only boost 1.40.0 available on the system.
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREAD OFF)
SET(BOOST_MIN_VERSION "1.47.0")
FIND_PACKAGE(Boost REQUIRED)
FIND_PACKAGE(Boost REQUIRED)
if (NOT Boost_FOUND)
message(FATAL_ERROR "Fatal error: Boost (version >= 1.47.0) required.\n")
endif (NOT Boost_FOUND)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
How did I get cmake to control the correct boost version, before compiling?