Skip to content

Commit 41c7658

Browse files
authored
Merge pull request CGAL#1357 from lrineau/CGAL-add_ctest_cont-lrineau
CTest support (cont.)
2 parents cf70fc1 + 82b25eb commit 41c7658

File tree

13 files changed

+1550
-26
lines changed

13 files changed

+1550
-26
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
language: cpp
22
dist: trusty
3+
before_install:
4+
- sudo add-apt-repository ppa:smspillaz/cmake-2.8.12 -y
35
install:
46
before_script:
57
- mkdir build

Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
project( Arrangement_on_surface_2_ )
66

7+
enable_testing()
8+
79
cmake_minimum_required(VERSION 2.8.10)
810

911
find_package(CGAL QUIET COMPONENTS Core)
@@ -16,11 +18,19 @@ if ( CGAL_FOUND )
1618

1719
include_directories (BEFORE "../../include")
1820

19-
# create a target per cppfile
20-
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
21-
foreach(cppfile ${cppfiles})
22-
create_single_source_cgal_program( "${cppfile}" )
23-
endforeach()
21+
if(COMMAND target_compile_options)
22+
# Since CMake-2.8.12: New CMake script, that defines the targets and
23+
# the CTest test cases.
24+
include( ${CMAKE_CURRENT_SOURCE_DIR}/cgal_test.cmake )
25+
else()
26+
# If CMake version is <= 2.8.11, use the usual CMake script.
27+
28+
# create a target per cppfile
29+
file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
30+
foreach(cppfile ${cppfiles})
31+
create_single_source_cgal_program( "${cppfile}" )
32+
endforeach()
33+
endif()
2434

2535
else()
2636

0 commit comments

Comments
 (0)