From 69ca424c5e25e4cea8b69bda88a8ce46b0b096ba Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 6 Feb 2018 15:08:54 +0100 Subject: [PATCH] Add CGAL_DEV_MODE --- Installation/CMakeLists.txt | 2 +- Installation/cmake/modules/CGALConfig_binary.cmake.in | 4 +++- Installation/cmake/modules/CGALConfig_install.cmake.in | 4 +++- Installation/cmake/modules/CGAL_Common.cmake | 5 +++++ Installation/cmake/modules/CGAL_SetupFlags.cmake | 6 +----- Installation/cmake/modules/UseCGAL.cmake | 2 +- 6 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 477c6cdb340..fd14bb7367b 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -551,7 +551,7 @@ message( "== Generate version files (DONE) ==\n") # #-------------------------------------------------------------------------------------------------- -if( RUNNING_CGAL_AUTO_TEST ) +if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) message("== Set up flags ==") # Ugly hack to be compatible with current CGAL testsuite process (as of diff --git a/Installation/cmake/modules/CGALConfig_binary.cmake.in b/Installation/cmake/modules/CGALConfig_binary.cmake.in index daee7e561d8..28fd9a1a872 100644 --- a/Installation/cmake/modules/CGALConfig_binary.cmake.in +++ b/Installation/cmake/modules/CGALConfig_binary.cmake.in @@ -186,7 +186,9 @@ include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) # Temporary? Change the CMAKE module path cgal_setup_module_path() -if( RUNNING_CGAL_AUTO_TEST ) +if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) + # Do not use -isystem for CGAL include paths + set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) # Ugly hack to be compatible with current CGAL testsuite process (as of # Nov. 2017). -- Laurent Rineau include(CGAL_SetupFlags) diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index 400b31e5273..04b71fc873f 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -158,7 +158,9 @@ include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) # Temporary? Change the CMAKE module path cgal_setup_module_path() -if( RUNNING_CGAL_AUTO_TEST ) +if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) + # Do not use -isystem for CGAL include paths + set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) # Ugly hack to be compatible with current CGAL testsuite process (as of # Nov. 2017). -- Laurent Rineau include(CGAL_SetupFlags) diff --git a/Installation/cmake/modules/CGAL_Common.cmake b/Installation/cmake/modules/CGAL_Common.cmake index 68a9791fde7..93d7aff6631 100644 --- a/Installation/cmake/modules/CGAL_Common.cmake +++ b/Installation/cmake/modules/CGAL_Common.cmake @@ -1,5 +1,10 @@ include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) +option(CGAL_DEV_MODE " +Activate the CGAL developers mode. \ +See https://github.com/CGAL/cgal/wiki/CGAL_DEV_MODE" + FALSE) + if(RUNNING_CGAL_AUTO_TEST) # Just to avoid a warning from CMake if that variable is set on the command line... endif() diff --git a/Installation/cmake/modules/CGAL_SetupFlags.cmake b/Installation/cmake/modules/CGAL_SetupFlags.cmake index 50465fc4a72..3b2187d9157 100644 --- a/Installation/cmake/modules/CGAL_SetupFlags.cmake +++ b/Installation/cmake/modules/CGAL_SetupFlags.cmake @@ -50,17 +50,13 @@ uniquely_add_flags( CMAKE_EXE_LINKER_FLAGS_DEBUG ${CGAL_EXE_LINKER_FLAGS_DE # Set a default build type if none is given if ( NOT CMAKE_BUILD_TYPE ) - if( RUNNING_CGAL_AUTO_TEST ) + if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) typed_cache_set ( STRING "Build type: Release, Debug, RelWithDebInfo or MinSizeRel" CMAKE_BUILD_TYPE Debug ) else () typed_cache_set ( STRING "Build type: Release, Debug, RelWithDebInfo or MinSizeRel" CMAKE_BUILD_TYPE Release ) endif() endif() -if( RUNNING_CGAL_AUTO_TEST ) - add_definitions(-DCGAL_TEST_SUITE) -endif() - if ( NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel" ) message( FATAL_ERROR "${CMAKE_BUILD_TYPE} is not a valid build type: only Release, Debug, RelWithDebInfo or MinSizeRel is allowed" ) diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index 9a70bf7ec18..1768e3a62a5 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -18,7 +18,7 @@ if(NOT USE_CGAL_FILE_INCLUDED) set(USE_CGAL_FILE_INCLUDED 1) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Common.cmake) - if( RUNNING_CGAL_AUTO_TEST ) + if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) include(${CMAKE_CURRENT_LIST_DIR}/CGAL_SetupFlags.cmake) else() include(${CMAKE_CURRENT_LIST_DIR}/CGAL_display_flags.cmake)