blob: aaff9e9343e7039fbe2592f387d2b8d7520c8cd3 (
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
|
#=============================================================================
# Kitware Information Macro Library
# Copyright 2010-2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
set(test_defs KWIML_NAMESPACE=${KWIML})
# Tell CMake how to follow dependencies of sources in this directory.
set_property(DIRECTORY
PROPERTY IMPLICIT_DEPENDS_INCLUDE_TRANSFORM
"KWIML_HEADER(%)=<${KWIML}/%>"
)
if(KWIML_LANGUAGE_C)
set(test_srcs test.c)
else()
set(test_srcs test.cxx)
endif()
if(KWIML_LANGUAGE_C)
list(APPEND test_defs KWIML_LANGUAGE_C)
list(APPEND test_srcs
test_ABI_C.c
test_INT_C.c
)
endif()
if(KWIML_LANGUAGE_CXX)
list(APPEND test_defs KWIML_LANGUAGE_CXX)
list(APPEND test_srcs
test_ABI_CXX.cxx
test_INT_CXX.cxx
)
endif()
foreach(th test_ABI_endian test_INT_format)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${th}.h.in
${CMAKE_CURRENT_BINARY_DIR}/${th}.h @ONLY)
endforeach()
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
add_executable(${KWIML}_test ${test_srcs})
set_property(TARGET ${KWIML}_test PROPERTY COMPILE_DEFINITIONS ${test_defs})
set_property(TARGET ${KWIML}_test PROPERTY
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_test(${KWIML}.test ${CMAKE_CURRENT_BINARY_DIR}/${KWIML}_test)
set_property(TEST ${KWIML}.test PROPERTY LABELS ${KWIML_LABELS_TEST})
|