Remove workarounds for CMake<3.11

This commit is contained in:
Laurent Rineau 2022-05-05 16:08:51 +02:00
parent 26cc69a4b4
commit c00c481e06
4 changed files with 14 additions and 43 deletions

View File

@ -1,3 +1,4 @@
cmake_minimum_required(VERSION 3.11)
if(Boost_IOSTREAMS_FOUND AND NOT TARGET CGAL::Boost_iostreams_support)
if( WIN32 )
@ -32,13 +33,7 @@ if(Boost_IOSTREAMS_FOUND AND NOT TARGET CGAL::Boost_iostreams_support)
add_library(CGAL::Boost_iostreams_support INTERFACE IMPORTED)
if(CMAKE_VERSION VERSION_LESS 3.11)
set_target_properties(CGAL::Boost_iostreams_support PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_BOOST_IOSTREAMS"
INTERFACE_LINK_LIBRARIES "${Boost_LIB};${ZLIB_LIBS}")
else()
set_target_properties(CGAL::Boost_iostreams_support PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_BOOST_IOSTREAMS")
target_link_libraries(CGAL::Boost_iostreams_support INTERFACE ${Boost_LIB} ${ZLIB_LIBS})
endif()
endif()

View File

@ -17,13 +17,6 @@ if( NOT CGAL_COMMON_FILE_INCLUDED )
message( FATAL_ERROR "CMAKE_ROOT environment variable not set. It should point to the directory where CMake is installed.")
endif()
# CMAKE_VERSION was introduced in 2.6.3 so we use it to detect the fact
if ( CMAKE_VERSION )
set( CMAKE_2_6_3_OR_ABOVE TRUE )
else()
set( CMAKE_2_6_3_OR_ABOVE FALSE )
endif()
if ( WIN32 )
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
if(CMAKE_UNAME)

View File

@ -23,6 +23,7 @@
# If set, the `LEDA` library will be searched and used to provide
# the exact number types used by CGAL kernels.
#
cmake_minimum_required(VERSION 3.11)
if(CGAL_SetupCGALDependencies_included)
return()
endif()
@ -117,22 +118,12 @@ function(CGAL_setup_CGAL_dependencies target)
if(MSVC)
target_compile_options(${target} INTERFACE
"-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS")
if(CMAKE_VERSION VERSION_LESS 3.11)
target_compile_options(${target} INTERFACE
/fp:strict
/fp:except-
/wd4503 # Suppress warnings C4503 about "decorated name length exceeded"
/bigobj # Use /bigobj by default
)
else()
# The MSVC generator supports `$<COMPILE_LANGUAGE: >` since CMake 3.11.
target_compile_options(${target} INTERFACE
$<$<COMPILE_LANGUAGE:CXX>:/fp:strict>
$<$<COMPILE_LANGUAGE:CXX>:/fp:except->
$<$<COMPILE_LANGUAGE:CXX>:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded"
$<$<COMPILE_LANGUAGE:CXX>:/bigobj> # Use /bigobj by default
)
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3)
message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected")
@ -157,12 +148,8 @@ function(CGAL_setup_CGAL_dependencies target)
endif()
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
if(CMAKE_VERSION VERSION_LESS 3.3)
target_compile_options(${target} INTERFACE "-frounding-math")
else()
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-frounding-math>")
endif()
endif()
if ( "${GCC_VERSION}" MATCHES "^4.2" )
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )
target_compile_options(${target} INTERFACE "-fno-strict-aliasing" )

View File

@ -9,7 +9,7 @@
# find_package(LEDA)
#
# and defines the function :command:`use_CGAL_LEDA_support`.
cmake_minimum_required(VERSION 3.11)
if(CGAL_SetupLEDA_included)
return()
endif()
@ -39,11 +39,7 @@ function(use_CGAL_LEDA_support target)
separate_arguments(LIST_LEDA_CXX_FLAGS UNIX_COMMAND "${LEDA_CXX_FLAGS}")
separate_arguments(LIST_LEDA_DEFINITIONS UNIX_COMMAND "${LEDA_DEFINITIONS} -DCGAL_USE_LEDA")
if(CMAKE_VERSION VERSION_LESS 3.3)
target_compile_options(${target} INTERFACE ${LIST_LEDA_CXX_FLAGS})
else()
target_compile_options(${target} INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${LIST_LEDA_CXX_FLAGS}>)
endif()
target_compile_options(${target} INTERFACE ${LIST_LEDA_DEFINITIONS})
target_include_directories(${target} SYSTEM INTERFACE ${LEDA_INCLUDE_DIR})