mirror of https://github.com/CGAL/cgal
Remove workarounds for CMake<3.11
This commit is contained in:
parent
26cc69a4b4
commit
c00c481e06
|
|
@ -1,3 +1,4 @@
|
||||||
|
cmake_minimum_required(VERSION 3.11)
|
||||||
if(Boost_IOSTREAMS_FOUND AND NOT TARGET CGAL::Boost_iostreams_support)
|
if(Boost_IOSTREAMS_FOUND AND NOT TARGET CGAL::Boost_iostreams_support)
|
||||||
|
|
||||||
if( WIN32 )
|
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)
|
add_library(CGAL::Boost_iostreams_support INTERFACE IMPORTED)
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.11)
|
set_target_properties(CGAL::Boost_iostreams_support PROPERTIES
|
||||||
set_target_properties(CGAL::Boost_iostreams_support PROPERTIES
|
INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_BOOST_IOSTREAMS")
|
||||||
INTERFACE_COMPILE_DEFINITIONS "CGAL_LINKED_WITH_BOOST_IOSTREAMS"
|
target_link_libraries(CGAL::Boost_iostreams_support INTERFACE ${Boost_LIB} ${ZLIB_LIBS})
|
||||||
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()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -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.")
|
message( FATAL_ERROR "CMAKE_ROOT environment variable not set. It should point to the directory where CMake is installed.")
|
||||||
endif()
|
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 )
|
if ( WIN32 )
|
||||||
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
|
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
|
||||||
if(CMAKE_UNAME)
|
if(CMAKE_UNAME)
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
# If set, the `LEDA` library will be searched and used to provide
|
# If set, the `LEDA` library will be searched and used to provide
|
||||||
# the exact number types used by CGAL kernels.
|
# the exact number types used by CGAL kernels.
|
||||||
#
|
#
|
||||||
|
cmake_minimum_required(VERSION 3.11)
|
||||||
if(CGAL_SetupCGALDependencies_included)
|
if(CGAL_SetupCGALDependencies_included)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
@ -117,22 +118,12 @@ function(CGAL_setup_CGAL_dependencies target)
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_compile_options(${target} INTERFACE
|
target_compile_options(${target} INTERFACE
|
||||||
"-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS")
|
"-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS")
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.11)
|
target_compile_options(${target} INTERFACE
|
||||||
target_compile_options(${target} INTERFACE
|
$<$<COMPILE_LANGUAGE:CXX>:/fp:strict>
|
||||||
/fp:strict
|
$<$<COMPILE_LANGUAGE:CXX>:/fp:except->
|
||||||
/fp:except-
|
$<$<COMPILE_LANGUAGE:CXX>:/wd4503> # Suppress warnings C4503 about "decorated name length exceeded"
|
||||||
/wd4503 # Suppress warnings C4503 about "decorated name length exceeded"
|
$<$<COMPILE_LANGUAGE:CXX>:/bigobj> # Use /bigobj by default
|
||||||
/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")
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang")
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.3)
|
||||||
message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected")
|
message(STATUS "Apple Clang version ${CMAKE_CXX_COMPILER_VERSION} compiler detected")
|
||||||
|
|
@ -157,11 +148,7 @@ function(CGAL_setup_CGAL_dependencies target)
|
||||||
endif()
|
endif()
|
||||||
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3)
|
||||||
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
|
message( STATUS "Using gcc version 4 or later. Adding -frounding-math" )
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.3)
|
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-frounding-math>")
|
||||||
target_compile_options(${target} INTERFACE "-frounding-math")
|
|
||||||
else()
|
|
||||||
target_compile_options(${target} INTERFACE "$<$<COMPILE_LANGUAGE:CXX>:-frounding-math>")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
if ( "${GCC_VERSION}" MATCHES "^4.2" )
|
if ( "${GCC_VERSION}" MATCHES "^4.2" )
|
||||||
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )
|
message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" )
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
# find_package(LEDA)
|
# find_package(LEDA)
|
||||||
#
|
#
|
||||||
# and defines the function :command:`use_CGAL_LEDA_support`.
|
# and defines the function :command:`use_CGAL_LEDA_support`.
|
||||||
|
cmake_minimum_required(VERSION 3.11)
|
||||||
if(CGAL_SetupLEDA_included)
|
if(CGAL_SetupLEDA_included)
|
||||||
return()
|
return()
|
||||||
endif()
|
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_CXX_FLAGS UNIX_COMMAND "${LEDA_CXX_FLAGS}")
|
||||||
separate_arguments(LIST_LEDA_DEFINITIONS UNIX_COMMAND "${LEDA_DEFINITIONS} -DCGAL_USE_LEDA")
|
separate_arguments(LIST_LEDA_DEFINITIONS UNIX_COMMAND "${LEDA_DEFINITIONS} -DCGAL_USE_LEDA")
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_LESS 3.3)
|
target_compile_options(${target} INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${LIST_LEDA_CXX_FLAGS}>)
|
||||||
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_compile_options(${target} INTERFACE ${LIST_LEDA_DEFINITIONS})
|
||||||
|
|
||||||
target_include_directories(${target} SYSTEM INTERFACE ${LEDA_INCLUDE_DIR})
|
target_include_directories(${target} SYSTEM INTERFACE ${LEDA_INCLUDE_DIR})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue