Skip to content

Commit

Permalink
CMake: Fail-fast if the used CMake version is too old for our Boost v…
Browse files Browse the repository at this point in the history
…ersion
  • Loading branch information
hoijui committed Dec 4, 2018
1 parent ce8b3d3 commit 1a1b68d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,18 @@ add_definitions(-DENABLE_CGAL)
# NOTE FindCGAL.cmake resets the BOOST_* and Boost_* variables,
# because it looks for Boost itself, so it has to be called
# before we look for our own required boost libraries.
find_package(Boost 1.36 REQUIRED COMPONENTS filesystem system thread regex program_options QUIET)
set(BOOST_DIRECTLY_REQUIRED_LIBRARIES filesystem system thread regex program_options)
find_package(Boost 1.36 REQUIRED COMPONENTS ${BOOST_DIRECTLY_REQUIRED_LIBRARIES} QUIET)
message(STATUS "Boost: ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}")
include_directories(${Boost_INCLUDE_DIRS})

# Check if boost dependency libraries have been found too
list(LENGTH BOOST_DIRECTLY_REQUIRED_LIBRARIES BOOST_DIRECTLY_REQUIRED_LIBRARIES_LENGTH)
list(LENGTH Boost_LIBRARIES Boost_LIBRARIES_LENGTH)
if(Boost_LIBRARIES_LENGTH EQUAL BOOST_DIRECTLY_REQUIRED_LIBRARIES_LENGTH)
message(FATAL_ERROR "No dependent Boost libraries found. Your CMake (${CMAKE_VERSION}) version might be too old for the version of boost you are using (${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}). In that case, you should have received warnings above of the type: 'Imported targets not available for Boost version ${Boost_VERSION}'")
endif()

find_package(HarfBuzz 0.9.19 REQUIRED QUIET)
message(STATUS "Harfbuzz: ${HARFBUZZ_VERSION}")
include_directories(${HARFBUZZ_INCLUDE_DIRS})
Expand Down

0 comments on commit 1a1b68d

Please sign in to comment.