Commit 2d74e546 authored by Kyle Edwards's avatar Kyle Edwards Committed by Brad King

Tests: Write cthwalloc helper tool

parent e34de069
......@@ -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)
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment