diff options
author | David Cole <david.cole@kitware.com> | 2011-12-07 21:29:13 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-12-07 21:29:13 (GMT) |
commit | 2d1195123ec85ffd04b415914cc5127db918d2c9 (patch) | |
tree | 7a05a915e9599c1596aa220ad620c965abe3902b /Utilities/KWIML/test/CMakeLists.txt | |
parent | 1eca18fd522575126b4d1e4faa3c9437d2f12e22 (diff) | |
parent | 9f18f64c7cfe57df96b6c2cd19d383f9532b6827 (diff) | |
download | CMake-2d1195123ec85ffd04b415914cc5127db918d2c9.zip CMake-2d1195123ec85ffd04b415914cc5127db918d2c9.tar.gz CMake-2d1195123ec85ffd04b415914cc5127db918d2c9.tar.bz2 |
Merge branch 'master' into AutomocIncludedDotMocFileHandling
Conflicts:
Source/cmTarget.cxx
Diffstat (limited to 'Utilities/KWIML/test/CMakeLists.txt')
-rw-r--r-- | Utilities/KWIML/test/CMakeLists.txt | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/Utilities/KWIML/test/CMakeLists.txt b/Utilities/KWIML/test/CMakeLists.txt new file mode 100644 index 0000000..a2359cc --- /dev/null +++ b/Utilities/KWIML/test/CMakeLists.txt @@ -0,0 +1,70 @@ +#============================================================================= +# 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}/%>" + ) + +# 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() + +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}) + +# 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() |