CMakeLists.txt 1.15 KB
Newer Older
1 2 3
#
# Testing
#
4
cmake_minimum_required (VERSION 2.7)
5
project (Testing)
6 7 8 9

#
# Lib and exe path
#
10
set (LIBRARY_OUTPUT_PATH
11
     ${Testing_BINARY_DIR}/bin/ CACHE PATH
12 13
     "Single output directory for building all libraries.")

14
set (EXECUTABLE_OUTPUT_PATH
15
     ${Testing_BINARY_DIR}/bin/ CACHE PATH
16 17 18 19 20
     "Single output directory for building all executables.")

#
# Where will executable tests be written ?
#
21 22
if (EXECUTABLE_OUTPUT_PATH)
  set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
23
else ()
24
  set (CXX_TEST_PATH .)
25
endif ()
26

27 28 29 30
#
# Include Dart
# (will also set NSLOOKUP, HOSTNAME, etc.)
#
31
include (${CMAKE_ROOT}/Modules/Dart.cmake)
32

33 34 35
#
# Extra coverage
#
36 37 38
build_command(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM})
build_name(BUILD_NAME_VAR)
site_name(SITE_NAME_VAR)
39 40 41 42

#
# Enable testing
#
43
enable_testing()
44 45 46 47

#
# Add test
#
48 49
add_executable(testing testing.cxx)
add_test(testing.1 ${Testing_BINARY_DIR}/bin/testing)
50

51
#
52
# skip level test
53
#
54
add_subdirectory(Sub/Sub2)
55

56
# Per-config target name and generator expressions.
57 58 59
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig)
add_test(NAME testing.perconfig COMMAND perconfig)
add_test(NAME testing.driver COMMAND ${PerConfig_COMMAND})