#--------------------------------------------------------------------------------------------------- # RootCTest.cmake # - basic setup for testing ROOT using CTest #--------------------------------------------------------------------------------------------------- #---Deduce the build name-------------------------------------------------------- set(BUILDNAME ${ROOT_ARCHTECTURE}-${CMAKE_BUILD_TYPE}) enable_testing() include(CTest) #---A number of operations to allow running the tests from the build directory----------------------- set(ROOT_DIR ${CMAKE_BINARY_DIR}) #---Test products should not be poluting the standard destinations-------------------------------- unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY) unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY) unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY) if(WIN32) foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG) unset(CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG}) unset(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIG}) unset(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIG}) endforeach() endif() #---Add all subdirectories with tests----------------------------------------------------------- get_property(test_dirs GLOBAL PROPERTY ROOT_TEST_SUBDIRS) foreach(d ${test_dirs}) add_subdirectory(${d}) endforeach()