diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index ea3f697b6ef..720ae284d4c 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -1,16 +1,12 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. - +cmake_minimum_required(VERSION 3.1...3.13) project( Cone_spanners_2_Examples ) -cmake_minimum_required(VERSION 3.1) - -find_package(CGAL QUIET COMPONENTS Core) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +include(${CGAL_USE_FILE}) find_package(LEDA QUIET) -if ( CGAL_FOUND AND ( CGAL_Core_FOUND OR LEDA_FOUND ) ) - include(${CGAL_USE_FILE}) +if ( CGAL_Core_FOUND OR LEDA_FOUND ) if (MSVC) # Turn off a boost related warning that appears with VC2015 # boost_1_65_1\boost\graph\named_function_params.hpp(240) : @@ -26,7 +22,7 @@ if ( CGAL_FOUND AND ( CGAL_Core_FOUND OR LEDA_FOUND ) ) else() - message(STATUS "This program requires the CGAL and CGAL_Core libraries, and will not be compiled.") + message(STATUS "This program requires the CGAL_Core library (or LEDA), and will not be compiled.") endif() diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt index 1298fd12303..4c19300f72c 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.1...3.13) + project (Hyperbolic_triangulation_2_Demo) # Find includes in corresponding build directories @@ -6,9 +8,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) -cmake_minimum_required(VERSION 3.1...3.13) - -find_package(CGAL QUIET COMPONENTS Core Qt5) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core Qt5) find_package(LEDA QUIET) find_package(Qt5 QUIET COMPONENTS Widgets) @@ -25,5 +25,5 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUN add_executable ( HDT2_demo HDT2.cpp ${CGAL_Qt5_RESOURCE_FILES} ${RESOURCE_FILES} ${UIS}) target_link_libraries ( HDT2_demo CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core Qt5::Widgets) else() - message(STATUS "NOTICE: This demo requires CGAL, CGAL_Core, and Qt5 and will not be compiled.") + message(STATUS "NOTICE: This demo requires CGAL, CGAL_Core (or LEDA), and Qt5 and will not be compiled.") endif() diff --git a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 41a8c74ae43..1354d6ec79d 100644 --- a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,24 +1,20 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. - +cmake_minimum_required(VERSION 3.1...3.13) project( Periodic_4_hyperbolic_triangulation_2_Examples ) -cmake_minimum_required(VERSION 2.8.10) - -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) +include( ${CGAL_USE_FILE} ) find_package(LEDA QUIET) -if ( CGAL_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND) ) - include( ${CGAL_USE_FILE} ) +if ( CGAL_Core_FOUND OR LEDA_FOUND ) - include( CGAL_CreateSingleSourceCGALProgram ) + include( CGAL_CreateSingleSourceCGALProgram ) - create_single_source_cgal_program( "p4ht2_example_insertion.cpp" ) + create_single_source_cgal_program( "p4ht2_example_insertion.cpp" ) else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message(STATUS "This program requires the CGAL library, and will not be compiled.") endif() diff --git a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h index a6f0fcf890e..f71c5a6b1a9 100644 --- a/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h +++ b/Periodic_4_hyperbolic_triangulation_2/include/CGAL/Periodic_4_hyperbolic_Delaunay_triangulation_traits_2.h @@ -31,7 +31,6 @@ #include #include -#include #include #include diff --git a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 345f4f1fa42..4a8d692d39a 100644 --- a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,32 +1,27 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. - +cmake_minimum_required(VERSION 3.1...3.13) project( Periodic_4_hyperbolic_triangulation_2_Tests ) -cmake_minimum_required(VERSION 2.8.10) - -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) +include( ${CGAL_USE_FILE} ) find_package(LEDA QUIET) if ( CGAL_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND) ) - include( ${CGAL_USE_FILE} ) + include( CGAL_CreateSingleSourceCGALProgram ) - include( CGAL_CreateSingleSourceCGALProgram ) + create_single_source_cgal_program( "test_p4ht2_construct_point_2.cpp" ) + create_single_source_cgal_program( "test_p4ht2_exact_complex_numbers.cpp" ) + create_single_source_cgal_program( "test_p4ht2_intersections.cpp" ) + create_single_source_cgal_program( "test_p4ht2_locate.cpp" ) + create_single_source_cgal_program( "test_p4ht2_matrix.cpp" ) + create_single_source_cgal_program( "test_p4ht2_removal_iterator.cpp" ) + create_single_source_cgal_program( "test_p4ht2_removal.cpp" ) + create_single_source_cgal_program( "test_p4ht2_insert_degenerate.cpp" ) - create_single_source_cgal_program( "test_p4ht2_construct_point_2.cpp" ) - create_single_source_cgal_program( "test_p4ht2_exact_complex_numbers.cpp" ) - create_single_source_cgal_program( "test_p4ht2_intersections.cpp" ) - create_single_source_cgal_program( "test_p4ht2_locate.cpp" ) - create_single_source_cgal_program( "test_p4ht2_matrix.cpp" ) - create_single_source_cgal_program( "test_p4ht2_removal_iterator.cpp" ) - create_single_source_cgal_program( "test_p4ht2_removal.cpp" ) - create_single_source_cgal_program( "test_p4ht2_insert_degenerate.cpp" ) - else() - message(STATUS "This program requires the CGAL library and the GMP library, and will not be compiled.") + message(STATUS "This program requires the CGAL library and the GMP library, and will not be compiled.") endif() diff --git a/Scripts/scripts/cgal_create_CMakeLists b/Scripts/scripts/cgal_create_CMakeLists index 63453a6d5f8..1492eccb72c 100755 --- a/Scripts/scripts/cgal_create_CMakeLists +++ b/Scripts/scripts/cgal_create_CMakeLists @@ -99,6 +99,8 @@ create_cmake_script_with_options() # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. +cmake_minimum_required(VERSION 3.1...3.13) + EOF #--------------------------------------------------------------------------- if [ "$SINGLE_SOURCE" = "n" ]; then @@ -111,8 +113,6 @@ EOF cat << 'EOF' -cmake_minimum_required(VERSION 2.8.11) - # CGAL and its components EOF if [ -n "$ENABLE_CTEST" ]; then @@ -172,7 +172,7 @@ fi fi - echo "find_package( CGAL QUIET COMPONENTS ${CGAL_COMPONENTS//:/ } )" + echo "find_package( CGAL REQUIRED QUIET OPTIONAL_COMPONENTS ${CGAL_COMPONENTS//:/ } )" #vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv cat << 'EOF' diff --git a/Scripts/scripts/cgal_create_cmake_script b/Scripts/scripts/cgal_create_cmake_script index 1722483fd0b..79002e65b60 100755 --- a/Scripts/scripts/cgal_create_cmake_script +++ b/Scripts/scripts/cgal_create_cmake_script @@ -40,19 +40,17 @@ create_cmake_script() # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - +cmake_minimum_required(VERSION 3.1...3.13) project( ${PROJECT}_${TYPE} ) EOF cat <<'EOF' -cmake_minimum_required(VERSION 2.8.10) - set(CMAKE_CXX_STANDARD 14) EOF cat <<'EOF' -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) if ( CGAL_FOUND ) diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt index c75cedded5b..56125b8ad68 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt @@ -1,50 +1,36 @@ -# Created by the script cgal_create_cmake_script -# This is the CMake script for compiling a CGAL application. - +cmake_minimum_required(VERSION 3.1...3.13) project( Surface_mesh_shortest_path_Tests ) -cmake_minimum_required(VERSION 3.1) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) +include(${CGAL_USE_FILE}) -find_package(CGAL QUIET COMPONENTS Core) find_package(LEDA QUIET) -if ( CGAL_FOUND ) +include_directories (BEFORE "include") - include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") +create_single_source_cgal_program( "Surface_mesh_shortest_path_test_1.cpp" ) +create_single_source_cgal_program( "Surface_mesh_shortest_path_test_2.cpp" ) +create_single_source_cgal_program( "Surface_mesh_shortest_path_test_3.cpp" ) +create_single_source_cgal_program( "Surface_mesh_shortest_path_test_4.cpp" ) +create_single_source_cgal_program( "Surface_mesh_shortest_path_traits_test.cpp" ) - create_single_source_cgal_program( "Surface_mesh_shortest_path_test_1.cpp" ) - create_single_source_cgal_program( "Surface_mesh_shortest_path_test_2.cpp" ) - create_single_source_cgal_program( "Surface_mesh_shortest_path_test_3.cpp" ) - create_single_source_cgal_program( "Surface_mesh_shortest_path_test_4.cpp" ) - create_single_source_cgal_program( "Surface_mesh_shortest_path_traits_test.cpp" ) - - - # Link with Boost.ProgramOptions (optional) - find_package(Boost QUIET COMPONENTS program_options) - if(Boost_PROGRAM_OPTIONS_FOUND) - if( CGAL_AUTO_LINK_ENABLED ) - message( STATUS "Boost.ProgramOptions library: found" ) - else() - message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" ) - endif() - add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) - list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) - if(CGAL_Core_FOUND OR LEDA_FOUND) - create_single_source_cgal_program( "TestMesh.cpp" ) - else() - message(STATUS "NOTICE: Example TestMesh.cpp requires CGAL_Core library and will not be compiled.") - endif() +# Link with Boost.ProgramOptions (optional) +find_package(Boost QUIET COMPONENTS program_options) +if(Boost_PROGRAM_OPTIONS_FOUND) + if( CGAL_AUTO_LINK_ENABLED ) + message( STATUS "Boost.ProgramOptions library: found" ) else() - message(STATUS "NOTICE: Example TestMesh.cpp requires boost program_option and will not be compiled.") + message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" ) + endif() + add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) + list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) + if(CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program( "TestMesh.cpp" ) + else() + message(STATUS "NOTICE: Example TestMesh.cpp requires the CGAL_Core library (or LEDA) and will not be compiled.") endif() - - else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message(STATUS "NOTICE: Example TestMesh.cpp requires boost program_option and will not be compiled.") endif() -