summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakeLists.txt
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-07-09 22:33:49 (GMT)
committerBrad King <brad.king@kitware.com>2019-10-02 13:33:54 (GMT)
commit2d74e54661953a02efa155ffe8c093400e5389c3 (patch)
tree80ef674a9376ab462e60449402d19ba138d812be /Tests/RunCMake/CMakeLists.txt
parente34de0691b3bd94720c44c1efad47c3d39ff4134 (diff)
downloadCMake-2d74e54661953a02efa155ffe8c093400e5389c3.zip
CMake-2d74e54661953a02efa155ffe8c093400e5389c3.tar.gz
CMake-2d74e54661953a02efa155ffe8c093400e5389c3.tar.bz2
Tests: Write cthwalloc helper tool
Diffstat (limited to 'Tests/RunCMake/CMakeLists.txt')
-rw-r--r--Tests/RunCMake/CMakeLists.txt32
1 files changed, 32 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index bd068fd..45c549b 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -335,6 +335,38 @@ add_RunCMake_test(no_install_prefix)
add_RunCMake_test(configure_file)
add_RunCMake_test(CTestTimeoutAfterMatch)
+# cthwalloc links against CMakeLib and CTestLib, which means it can't be built
+# if CMake_TEST_EXTERNAL_CMAKE is activated (the compiler might be different.)
+# So, it has to be provided in the original build tree.
+if(CMake_TEST_EXTERNAL_CMAKE)
+ set(no_package_root_path)
+ if(NOT CMAKE_VERSION VERSION_LESS 3.12)
+ set(no_package_root_path NO_PACKAGE_ROOT_PATH)
+ endif()
+ find_program(cthwalloc cthwalloc PATHS ${CMake_TEST_EXTERNAL_CMAKE}
+ NO_DEFAULT_PATH
+ ${no_package_root_path}
+ NO_CMAKE_PATH
+ NO_CMAKE_ENVIRONMENT_PATH
+ NO_SYSTEM_ENVIRONMENT_PATH
+ NO_CMAKE_SYSTEM_PATH
+ NO_CMAKE_FIND_ROOT_PATH
+ )
+ if(cthwalloc)
+ add_executable(cthwalloc IMPORTED)
+ set_property(TARGET cthwalloc PROPERTY IMPORTED_LOCATION ${cthwalloc})
+ endif()
+else()
+ add_executable(cthwalloc CTestHardwareAllocation/cthwalloc.cxx)
+ target_link_libraries(cthwalloc CTestLib)
+ target_include_directories(cthwalloc PRIVATE
+ ${CMake_BINARY_DIR}/Source
+ ${CMake_SOURCE_DIR}/Source
+ ${CMake_SOURCE_DIR}/Source/CTest
+ )
+ set_property(TARGET cthwalloc PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMake_BIN_DIR})
+endif()
+
find_package(Qt4 QUIET)
find_package(Qt5Core QUIET)
if (QT4_FOUND AND Qt5Core_FOUND AND NOT Qt5Core_VERSION VERSION_LESS 5.1.0)