From 85e47804aadfa6dcd3ae0b52244942dca7d7fbf7 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 May 2016 11:14:16 +0200 Subject: [PATCH] Allow using CTEST_USE_LAUNCHERS even when tests are disabled Since cmake >= 3.0, using CTEST_USE_LAUNCHERS requires include(CTestUseLaunchers), which is automatically done by include(CTest) Setting CTEST_USE_LAUNCHERS in the cache without including CTest later triggers a configuration error : CMake Error: CTEST_USE_LAUNCHERS is enabled, but the RULE_LAUNCH_COMPILE global property is not defined. Did you forget to include(CTest) in the toplevel CMakeLists.txt ? CTEST_USE_LAUNCHERS was silently ignored in cmake <= 2.8 when not including CTest Include CTestUseLaunchers always, so that CTEST_USE_LAUNCHERS can be used even when not including CTest (for example for MinGW builds). This helps presenting the build errors and warnings more cleanly on the Dashboard. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f3753ff..4dfade8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -318,6 +318,9 @@ if(BUILD_TESTING) endif() endif() +# Allow the use of CTEST_USE_LAUNCHERS even when not including CTest (mingw builds) +include(CTestUseLaunchers OPTIONAL) + #----------------------------------------------------------------------------- # install all targets referenced as OPENJPEGTargets install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})