Fix CMakeLists: make components of Boost needed for classif optional

This commit is contained in:
Simon Giraudot 2017-12-22 13:55:37 +01:00
parent 8f076ae77f
commit 8c725b75a9
2 changed files with 4 additions and 6 deletions

View File

@ -19,7 +19,7 @@ include( ${CGAL_USE_FILE} )
# Boost and its components
find_package( Boost REQUIRED COMPONENTS serialization iostreams)
find_package( Boost REQUIRED OPTIONAL_COMPONENTS serialization iostreams)
if ( NOT Boost_FOUND )
message(STATUS "This project requires the Boost library, and will not be compiled.")
@ -56,13 +56,12 @@ set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
set(classification_linked_libraries)
set(classification_compile_definitions)
find_package(Boost COMPONENTS serialization iostreams)
if (Boost_SERIALIZATION_FOUND AND Boost_IOSTREAMS_FOUND)
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_SERIALIZATION_LIBRARY}
${Boost_IOSTREAMS_LIBRARY})
else()
message(STATUS "ERROR: Boost Serialization or IO Streams not found.")
message(STATUS "NOTICE: Boost Serialization or IO Streams not found, no example will be compiled.")
exit()
endif()

View File

@ -21,7 +21,7 @@ include( ${CGAL_USE_FILE} )
# Boost and its components
find_package( Boost REQUIRED )
find_package( Boost REQUIRED OPTIONAL_COMPONENTS serialization iostreams)
# Use Eigen
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)
@ -59,13 +59,12 @@ set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates)
# Libraries and flags
set(classification_linked_libraries)
find_package(Boost COMPONENTS serialization iostreams)
if (Boost_SERIALIZATION_FOUND AND Boost_IOSTREAMS_FOUND)
set(classification_linked_libraries ${classification_linked_libraries}
${Boost_SERIALIZATION_LIBRARY}
${Boost_IOSTREAMS_LIBRARY})
else()
message(STATUS "ERROR: Boost Serialization or IO Streams not found.")
message(STATUS "NOTICE: Boost Serialization or IO Streams not found, no test will be compiled.")
exit()
endif()