blob: cae03770790a6ca7e3ee76784293949e3fdfece9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
#
# A more complex test case
#
PROJECT (Complex)
#
# Use the ansi CXX compile flag for building cmake
#
IF (CMAKE_ANSI_CXXFLAGS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
ENDIF (CMAKE_ANSI_CXXFLAGS)
ADD_DEFINITIONS(-DCMAKE_IS_FUN)
IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake)
ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake)
LOAD_CACHE(${Complex_SOURCE_DIR})
CONFIGURE_FILE(
${Complex_SOURCE_DIR}/cmTestConfigure.h.in
${Complex_BINARY_DIR}/cmTestConfigure.h)
INCLUDE_DIRECTORIES(
${Complex_BINARY_DIR}
${Complex_SOURCE_DIR}/Library
${Complex_SOURCE_DIR}/../../Source
)
LINK_DIRECTORIES(
${Complex_BINARY_DIR}/Library
)
INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile).*$")
SET (LIBRARY_OUTPUT_PATH
${Complex_BINARY_DIR}/bin/ CACHE PATH
"Single output directory for building all libraries.")
SET (EXECUTABLE_OUTPUT_PATH
${Complex_BINARY_DIR}/bin/ CACHE PATH
"Single output directory for building all executables.")
#
# Where will executable tests be written ?
#
IF (EXECUTABLE_OUTPUT_PATH)
SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
ELSE (EXECUTABLE_OUTPUT_PATH)
SET (CXX_TEST_PATH .)
ENDIF (EXECUTABLE_OUTPUT_PATH)
SUBDIRS(Library Executable)
SUBDIR_DEPENDS(Executable Library)
#
# Exec program (TODO: test a result)
# Increase coverage.
#
OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0)
IF (NOT NO_EXEC_PROGRAM)
EXEC_PROGRAM("echo NO_EXEC_PROGRAM" "${Complex_BINARY_DIR}")
ELSE (NOT NO_EXEC_PROGRAM)
MESSAGE("Set this option ON")
ENDIF (NOT NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
#
# More coverage
#
ABSTRACT_FILES(
ExtraSources/file1.cxx
)
INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h)
#
# Create directory.
# The 'complex' executable will then test if this dir exists,
# sadly it won't be able to remove it.
#
MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir")
#
# Testing
#
ENABLE_TESTING()
#
# Test Cable
#
CABLE_CLASS_SET(Float float)
CABLE_CLASS_SET(Mesh "itk::Mesh<$Float>")
|