mirror of https://github.com/CGAL/cgal
Replace include(CTest) by minimal usage
- Define the option `BUILD_TESTING` - Call to `enable_testing()` if `BUILD_TESTING` is on.
This commit is contained in:
parent
e42cc50e7d
commit
02690350ee
|
|
@ -37,11 +37,13 @@ message( "== CMake setup (DONE) ==\n" )
|
||||||
|
|
||||||
# Enable testing with BUILD_TESTING
|
# Enable testing with BUILD_TESTING
|
||||||
option(BUILD_TESTING "Build the testing tree." OFF)
|
option(BUILD_TESTING "Build the testing tree." OFF)
|
||||||
include(CTest)
|
|
||||||
if(BUILD_TESTING AND NOT POLICY CMP0064)
|
if(BUILD_TESTING AND NOT POLICY CMP0064)
|
||||||
message(FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later.
|
message(FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later.
|
||||||
The variable BUILD_TESTING must be set of OFF.")
|
The variable BUILD_TESTING must be set of OFF.")
|
||||||
endif()
|
endif()
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
enable_testing()
|
||||||
|
endif()
|
||||||
|
|
||||||
# and finally start actual build
|
# and finally start actual build
|
||||||
add_subdirectory( Installation )
|
add_subdirectory( Installation )
|
||||||
|
|
|
||||||
|
|
@ -108,11 +108,13 @@ else ( CGAL_BRANCH_BUILD )
|
||||||
|
|
||||||
# Enable testing with BUILD_TESTING
|
# Enable testing with BUILD_TESTING
|
||||||
option(BUILD_TESTING "Build the testing tree." OFF)
|
option(BUILD_TESTING "Build the testing tree." OFF)
|
||||||
include(CTest)
|
|
||||||
if(BUILD_TESTING AND NOT POLICY CMP0064)
|
if(BUILD_TESTING AND NOT POLICY CMP0064)
|
||||||
message(FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later.
|
message(FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later.
|
||||||
The variable BUILD_TESTING must be set of OFF.")
|
The variable BUILD_TESTING must be set of OFF.")
|
||||||
endif()
|
endif()
|
||||||
|
if(BUILD_TESTING)
|
||||||
|
enable_testing()
|
||||||
|
endif()
|
||||||
endif (CGAL_BRANCH_BUILD )
|
endif (CGAL_BRANCH_BUILD )
|
||||||
|
|
||||||
#message(STATUS "Packages found: ${CGAL_CONFIGURED_PACKAGES}")
|
#message(STATUS "Packages found: ${CGAL_CONFIGURED_PACKAGES}")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ if(CGAL_add_test_included)
|
||||||
endif(CGAL_add_test_included)
|
endif(CGAL_add_test_included)
|
||||||
set(CGAL_add_test_included TRUE)
|
set(CGAL_add_test_included TRUE)
|
||||||
|
|
||||||
|
option(BUILD_TESTING "Build the testing tree." OFF)
|
||||||
|
|
||||||
if(NOT POLICY CMP0064)
|
if(NOT POLICY CMP0064)
|
||||||
# CMake <= 3.3
|
# CMake <= 3.3
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
|
|
@ -19,7 +21,9 @@ if(NOT POLICY CMP0064)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(CTest)
|
if(BUILD_TESTING)
|
||||||
|
enable_testing()
|
||||||
|
endif()
|
||||||
|
|
||||||
cmake_policy(SET CMP0064 NEW)
|
cmake_policy(SET CMP0064 NEW)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue