From 70a7fce1fc62d6039c5f79b854bf364274200ba7 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 7 May 2019 11:23:00 +0200 Subject: [PATCH] Fix the handling of Boost - only search for Boost if extra Boost components are required, - do not test `Boost_FOUND` (because Boost is `REQUIRED` in `find_package`), - use Boost imported targets instead of variable (compatibility with Boost-1.70 CMake config mode) --- Scripts/scripts/cgal_create_CMakeLists | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/Scripts/scripts/cgal_create_CMakeLists b/Scripts/scripts/cgal_create_CMakeLists index a3914678290..9efe5293e86 100755 --- a/Scripts/scripts/cgal_create_CMakeLists +++ b/Scripts/scripts/cgal_create_CMakeLists @@ -164,36 +164,16 @@ EOF fi #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' + if [ ! -z "$BOOST_COMPONENTS" ]; then + cat << 'EOF' # Boost and its components EOF - #--------------------------------------------------------------------------- - - if [ ! -z "$BOOST_COMPONENTS" ]; then - echo "find_package( Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS//:/ } )" - else - - echo "find_package( Boost REQUIRED )" - fi # additional Boost components - - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv - cat << 'EOF' - -if ( NOT Boost_FOUND ) - - message(STATUS "This project requires the Boost library, and will not be compiled.") - - return() - -endif() -EOF #--------------------------------------------------------------------------- - #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv cat << 'EOF' @@ -239,7 +219,7 @@ EOF for boost_component in $BOOST_COMPONENTS; do BOOST_COMPONENT=`echo $boost_component | tr '[:lower:]' '[:upper:]'` echo "add_definitions( \"-DCGAL_USE_BOOST_${BOOST_COMPONENT}\" )" - echo "list(APPEND CGAL_3RD_PARTY_LIBRARIES \${Boost_${BOOST_COMPONENT}_LIBRARY} )" + echo "list(APPEND CGAL_3RD_PARTY_LIBRARIES Boost::${boost_component} )" done IFS=$OLDIFS