diff options
author | Brad King <brad.king@kitware.com> | 2015-11-24 14:26:42 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-11-24 14:26:42 (GMT) |
commit | f66f6e2490a883ecb9a9505d87f76869980e776f (patch) | |
tree | f37d80a6e041f5b3a84a02798ef4a8ace879d8cb /Tests | |
parent | bc1136b2753e82f9d98a4870f2ff026fbefe7ace (diff) | |
parent | 5dcc833b28eecc95486852f032a54edc64f76eec (diff) | |
download | CMake-f66f6e2490a883ecb9a9505d87f76869980e776f.zip CMake-f66f6e2490a883ecb9a9505d87f76869980e776f.tar.gz CMake-f66f6e2490a883ecb9a9505d87f76869980e776f.tar.bz2 |
Merge topic 'FindXercesC-imported-targets'
5dcc833b FindXercesC: Add imported targets and unit test
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/FindXercesC/CMakeLists.txt | 10 | ||||
-rw-r--r-- | Tests/FindXercesC/Test/CMakeLists.txt | 17 | ||||
-rw-r--r-- | Tests/FindXercesC/Test/main.cxx | 7 |
4 files changed, 38 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index dd766ae..5fd7159 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1367,6 +1367,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindOpenSSL) endif() + if(CMake_TEST_FindXercesC) + add_subdirectory(FindXercesC) + endif() + add_subdirectory(FindThreads) # Matlab module diff --git a/Tests/FindXercesC/CMakeLists.txt b/Tests/FindXercesC/CMakeLists.txt new file mode 100644 index 0000000..633f613 --- /dev/null +++ b/Tests/FindXercesC/CMakeLists.txt @@ -0,0 +1,10 @@ +add_test(NAME FindXercesC.Test COMMAND + ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION> + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindXercesC/Test" + "${CMake_BINARY_DIR}/Tests/FindXercesC/Test" + ${build_generator_args} + --build-project TestFindXercesC + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V -C $<CONFIGURATION> + ) diff --git a/Tests/FindXercesC/Test/CMakeLists.txt b/Tests/FindXercesC/Test/CMakeLists.txt new file mode 100644 index 0000000..8e7767c --- /dev/null +++ b/Tests/FindXercesC/Test/CMakeLists.txt @@ -0,0 +1,17 @@ +cmake_minimum_required(VERSION 3.1) +project(TestFindXercesC CXX) +include(CTest) + +# CMake does not actually provide FindXercesC publicly. +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Modules) + +find_package(XercesC REQUIRED) + +add_executable(test_xercesc_tgt main.cxx) +target_link_libraries(test_xercesc_tgt XercesC::XercesC) +add_test(NAME test_xercesc_tgt COMMAND test_xercesc_tgt) + +add_executable(test_xercesc_var main.cxx) +target_include_directories(test_xercesc_var PRIVATE ${XercesC_INCLUDE_DIRS}) +target_link_libraries(test_xercesc_var PRIVATE ${XercesC_LIBRARIES}) +add_test(NAME test_xercesc_var COMMAND test_xercesc_var) diff --git a/Tests/FindXercesC/Test/main.cxx b/Tests/FindXercesC/Test/main.cxx new file mode 100644 index 0000000..1794fa6 --- /dev/null +++ b/Tests/FindXercesC/Test/main.cxx @@ -0,0 +1,7 @@ +#include <xercesc/util/PlatformUtils.hpp> + +int main() +{ + xercesc::XMLPlatformUtils::Initialize(); + xercesc::XMLPlatformUtils::Terminate(); +} |