remove CMP code now that we only support from cmake 3.13

This commit is contained in:
Maxime Gimeno 2020-10-08 11:50:22 +02:00
parent 733c487cc2
commit 221bbdd4b1
7 changed files with 33 additions and 58 deletions

View File

@ -1131,7 +1131,7 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include)
set(check_pkg_headers_depends "")
# Then recurse2
file(GLOB_RECURSE ${package}_HEADERS
file(GLOB_RECURSE ${package}_HEADERS #don't use a hard coded list because the ones for the documented headers is enough.
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/CGAL/*.h*")
list(SORT ${package}_HEADERS)

View File

@ -57,13 +57,10 @@ function(create_single_source_cgal_program firstfile )
set(NO_TESTING TRUE)
endif()
if(POLICY CMP0064)
# CMake 3.4 or later
if(NOT NO_TESTING)
cgal_add_test(${exe_name})
else()
cgal_add_test(${exe_name} NO_EXECUTION)
endif()
if(NOT NO_TESTING)
cgal_add_test(${exe_name})
else()
cgal_add_test(${exe_name} NO_EXECUTION)
endif()
add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} )

View File

@ -1,33 +1,31 @@
# - Defines Boost_USE_STATIC_LIBS and Boost_ADDITIONAL_VERSIONS
#
#
# This module sets the CMake variables:
#
#
# == Boost_USE_STATIC_LIBS ==
#
#
# The option CGAL_Boost_USE_STATIC_LIBS is created in the cache, as
# advanced option. If CGALConfig.cmake has been loaded, the default value
# of that option is the value loaded from CGALConfig.cmake (this file was
# created during the configuration of CGAL libraries). Otherwise, the
# default value of that option is OFF.
#
#
# The variable Boost_USE_STATIC_LIBS is set to the value of the option
# CGAL_Boost_USE_STATIC_LIBS.
#
#
# Additionally, if Boost_USE_STATIC_LIBS is OFF, and the auto-linking is
# enabled, the definition BOOST_ALL_DYN_LINK is added to
# CGAL_3RD_PARTY_DEFINITIONS, so that the auto-linking feature on Windows
# knows that it must search for dynamic libraries.
#
#
# == Boost_ADDITIONAL_VERSIONS ==
#
#
# The variable Boost_ADDITIONAL_VERSIONS is filled with a long list of
# Boost versions. That allows the module FindBoost to find more recent
# Boost versions, even if the file FindBoost.cmake is old.
if( NOT CGAL_TweakFindBoost )
if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()
cmake_policy(SET CMP0077 NEW)
if(DEFINED CGAL_Boost_USE_STATIC_LIBS)
# If the option is loaded from CGALConfig.cmake, use its value as default
# value. But the user will still have the choice to change the
@ -50,7 +48,7 @@ if( NOT CGAL_TweakFindBoost )
option(CGAL_Boost_USE_STATIC_LIBS "Link with static Boost libraries" ${CGAL_Boost_USE_STATIC_LIBS_DEFAULT})
mark_as_advanced(CGAL_Boost_USE_STATIC_LIBS)
if(CGAL_Boost_USE_STATIC_LIBS)
if(CGAL_Boost_USE_STATIC_LIBS)
set(Boost_USE_STATIC_LIBS ON)
else()
set(Boost_USE_STATIC_LIBS OFF)
@ -60,7 +58,7 @@ if( NOT CGAL_TweakFindBoost )
list(APPEND CGAL_3RD_PARTY_DEFINITIONS -DBOOST_ALL_DYN_LINK)
set(CGAL_3RD_PARTY_DEFINITIONS "${CGAL_3RD_PARTY_DEFINITIONS}"
CACHE INTERNAL "3rd party definitions for CGAL")
CACHE INTERNAL "3rd party definitions for CGAL")
endif()
endif()

View File

@ -5,25 +5,6 @@ set(CGAL_add_test_included TRUE)
option(BUILD_TESTING "Build the testing tree." OFF)
if(NOT POLICY CMP0064)
# CMake <= 3.3
if(BUILD_TESTING)
message(WARNING
"CGAL CTest support requires CMake 3.4 or later.\n"
"You must either disable BUILD_TESTING or upgrade CMake.")
endif()
# Add a fake function to avoid CMake errors
function(cgal_add_compilation_test)
endfunction()
# Add a fake function to avoid CMake errors
function(cgal_setup_test_properties)
endfunction()
# Then return, to exit the file
return()
endif()
if(BUILD_TESTING)
enable_testing()
endif()
@ -94,7 +75,7 @@ function(expand_list_with_globbing list_name)
endfunction()
function(cgal_add_compilation_test exe_name)
if(NOT POLICY CMP0064 OR TEST compilation_of__${exe_name})
if(TEST compilation_of__${exe_name})
return()
endif()
add_test(NAME "compilation_of__${exe_name}"
@ -111,15 +92,11 @@ function(cgal_add_compilation_test exe_name)
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$<CONFIG>")
set_property(TEST "check_build_system"
APPEND PROPERTY LABELS "${PROJECT_NAME}")
if(POLICY CMP0066) # cmake 3.7 or later
set_property(TEST "check_build_system"
PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture")
endif()
endif()
if(POLICY CMP0066) # cmake 3.7 or later
set_property(TEST "compilation_of__${exe_name}"
APPEND PROPERTY FIXTURES_REQUIRED "check_build_system_SetupFixture")
set_property(TEST "check_build_system"
PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture")
endif()
set_property(TEST "compilation_of__${exe_name}"
APPEND PROPERTY FIXTURES_REQUIRED "check_build_system_SetupFixture")
endfunction(cgal_add_compilation_test)
option(CGAL_TEST_DRAW_FUNCTIONS "If set, the ctest command will not skip the tests of the draw functions.")
@ -147,8 +124,7 @@ function(cgal_setup_test_properties test_name)
get_filename_component(_binary_dir_abs ${CMAKE_CURRENT_BINARY_DIR} ABSOLUTE)
string(FIND "${_binary_dir_abs}" "${_source_dir_abs}" _search_binary_in_source)
if(_search_binary_in_source EQUAL "-1"
AND POLICY CMP0066) # CMake 3.7 or later
if(_search_binary_in_source EQUAL "-1")
if(NOT TEST ${PROJECT_NAME}_SetupFixture)
if(ANDROID)
add_test(NAME ${PROJECT_NAME}_SetupFixture
@ -260,7 +236,7 @@ function(cgal_add_test exe_name)
set(test_name "execution___of__${exe_name}")
endif()
# message(" test_name: ${test_name}")
if(cgal_add_test_NO_EXECUTION OR NOT POLICY CMP0064 OR TEST ${test_name})
if(cgal_add_test_NO_EXECUTION OR TEST ${test_name})
return()
endif()
# message("Add test ${test_name}")
@ -303,11 +279,11 @@ function(cgal_add_test exe_name)
set(ARGS)
# message(STATUS "DEBUG test ${exe_name}")
foreach(CMD_LINE ${CMD_LINES})
# message(STATUS " command line: ${CMD_LINE}")
# message(STATUS " command line: ${CMD_LINE}")
string(REGEX REPLACE "\#.*" "" CMD_LINE "${CMD_LINE}")
separate_arguments(CMD_LINE_ARGS UNIX_COMMAND ${CMD_LINE})
# message(STATUS " args: ${CMD_LINE_ARGS}")
list(APPEND ARGS ${CMD_LINE_ARGS})
separate_arguments(CMD_LINE_ARGS UNIX_COMMAND ${CMD_LINE})
# message(STATUS " args: ${CMD_LINE_ARGS}")
list(APPEND ARGS ${CMD_LINE_ARGS})
endforeach()
expand_list_with_globbing(ARGS)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

View File

@ -34,4 +34,4 @@ set(list_of_whitelisted_headers_txt [=[
]=])
separate_arguments(example_files UNIX_COMMAND ${list_of_whitelisted_headers_txt})
separate_arguments(list_of_whitelisted_headers UNIX_COMMAND ${list_of_whitelisted_headers_txt})

View File

@ -7,7 +7,7 @@ SET(CMAKE_CXX_FLAGS "/DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECATE
SET(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1" CACHE STRING "")
SET(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2 /DCGAL_NDEBUG" CACHE STRING "")
SET(TBBROOT "C:/3rdPartyLibs/tbb2018_20170919oss" CACHE STRING "")
SET(WITH_GMP ON CACHE BOOL "")
@ -20,6 +20,8 @@ SET(WITH_NTL OFF CACHE BOOL "")
SET(WITH_demos ON CACHE BOOL "")
SET(CGAL_HEADER_ONLY ON CACHE BOOL "")
SET(Boost_DIR "C:\\3rdPartyLibs\\boost_master\\install_dir\\lib\\cmake\\Boost-1.71.0" CACHE PATH "")
SET(CGAL_Boost_USE_STATIC_LIBS ON CACHE BOOL "")
SET(CGAL_Boost_USE_STATIC_LIBS ON CACHE BOOL "")

View File

@ -21,3 +21,5 @@ SET(WITH_MPFR ON CACHE BOOL "")
SET(WITH_NTL OFF CACHE BOOL "")
SET(WITH_demos ON CACHE BOOL "")
SET(CGAL_HEADER_ONLY ON CACHE BOOL "")