diff options
author | Brad King <brad.king@kitware.com> | 2015-12-17 19:56:40 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-12-17 19:56:40 (GMT) |
commit | 12293371ee0f3b930afee8d328415968eb8201e6 (patch) | |
tree | 25d0d679620e4129a2bbe6e1c8338a3a1fa9fd23 /Utilities/KWIML/test/CMakeLists.txt | |
parent | 55b21d072e2df9a35a354fd33e8cf2d0c3bd22be (diff) | |
parent | 3fdbb0a806f67f10ea8428e03a4523d08d2b083c (diff) | |
download | CMake-12293371ee0f3b930afee8d328415968eb8201e6.zip CMake-12293371ee0f3b930afee8d328415968eb8201e6.tar.gz CMake-12293371ee0f3b930afee8d328415968eb8201e6.tar.bz2 |
Merge branch 'upstream-KWIML' into import-kwiml
* upstream-KWIML:
KWIML 2015-12-09 (43f9f8d0)
Diffstat (limited to 'Utilities/KWIML/test/CMakeLists.txt')
-rw-r--r-- | Utilities/KWIML/test/CMakeLists.txt | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Utilities/KWIML/test/CMakeLists.txt b/Utilities/KWIML/test/CMakeLists.txt new file mode 100644 index 0000000..4f6f37b --- /dev/null +++ b/Utilities/KWIML/test/CMakeLists.txt @@ -0,0 +1,54 @@ +# +# Copyright Kitware, Inc. +# Distributed under the OSI-approved BSD 3-Clause License. +# See accompanying file Copyright.txt for details. +# +if(NOT KWIML_TEST_PREFIX) + set(KWIML_TEST_PREFIX kwiml) +endif() + +# Suppress printf/scanf format warnings; we test if the sizes match. +foreach(lang C CXX) + if(KWIML_LANGUAGE_${lang} AND CMAKE_${lang}_COMPILER_ID STREQUAL "GNU") + set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wno-format") + endif() +endforeach() + +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 + test_include_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 + test_include_CXX.cxx + ) +endif() + +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(NAME ${KWIML_TEST_PREFIX}.test COMMAND kwiml_test) +set_property(TEST ${KWIML_TEST_PREFIX}.test PROPERTY LABELS ${KWIML_TEST_LABELS}) + +# Xcode 2.x forgets to create the output directory before linking +# the individual architectures. +if(CMAKE_OSX_ARCHITECTURES AND XCODE + AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") + add_custom_command( + TARGET kwiml_test + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) +endif() |