From 85e47804aadfa6dcd3ae0b52244942dca7d7fbf7 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 May 2016 11:14:16 +0200 Subject: [PATCH 1/6] 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 6f3753ff4..4dfade8e7 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}) From 37ce88ad4488946857f9df53c6c2983b94425558 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 May 2016 11:19:11 +0200 Subject: [PATCH 2/6] Document use of OPTIONAL flag --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4dfade8e7..832c5628c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -319,6 +319,8 @@ if(BUILD_TESTING) endif() # Allow the use of CTEST_USE_LAUNCHERS even when not including CTest (mingw builds) +# CTestUseLaunchers module is only available starting cmake >= 3.0. Using OPTIONAL flag +# to cope with it include(CTestUseLaunchers OPTIONAL) #----------------------------------------------------------------------------- From 468c8bb69734011a90a14a4c56388e0b6092a984 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 May 2016 11:27:35 +0200 Subject: [PATCH 3/6] Enable CTEST_USE_LAUNCHERS for Travis builds --- tools/ctest_scripts/travis-ci.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index f8c50e5be..287e79598 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -23,6 +23,15 @@ else() set( JPYLYZER_EXT "py" ) endif() +# Choose CTest reporting mode. +if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make") + # Launchers work only with Makefile generators. + set(CTEST_USE_LAUNCHERS 0) +elseif(NOT DEFINED CTEST_USE_LAUNCHERS) + # The setting is ignored by CTest < 2.8 so we need no version test. + set(CTEST_USE_LAUNCHERS 1) +endif() + if ("$ENV{OPJ_BUILD_CONFIGURATION}" STREQUAL "") set( CTEST_BUILD_CONFIGURATION "Release") else() @@ -112,6 +121,8 @@ OPJ_DATA_ROOT:PATH=$ENV{PWD}/data # jpylyzer is available with on GitHub: https://github.com/openpreserve/jpylyzer JPYLYZER_EXECUTABLE=$ENV{PWD}/jpylyzer/jpylyzer.${JPYLYZER_EXT} +# Better build error/warning reports on the dashboard +CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS} " ) #--------------------- From 8f2afb3c7a78e41e26f1ea14bfc05916c6b4e24e Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 May 2016 12:22:20 +0200 Subject: [PATCH 4/6] Fix indentation --- tools/travis-ci/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index 1a4c0bb97..0ebb3f783 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -62,7 +62,7 @@ if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data # We need jpylyzer for the test suite - JPYLYZER_VERSION="1.17.0" + JPYLYZER_VERSION="1.17.0" echo "Retrieving jpylyzer" if [ "${APPVEYOR:-}" == "True" ]; then wget --local-encoding=UTF-8 -q http://dl.bintray.com/openplanets/opf-windows/jpylyzer_${JPYLYZER_VERSION}_win32.zip From 90ecbc54dec871d4ae4f6c1209fca01c5626c439 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 May 2016 13:58:03 +0200 Subject: [PATCH 5/6] Use cmake 3.5 on linux builds inside Travis --- tools/travis-ci/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index 0ebb3f783..b01a688ae 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -35,7 +35,7 @@ if [ "${COVERITY_SCAN_BRANCH:-}" == "1" ] || [ "${OPJ_CI_ABI_CHECK:-}" == "1" ]; exit 0 fi -if [ "${OPJ_CI_ASAN:-}" == "1" ]; then +if [ "${TRAVIS_OS_NAME:-}" == "linux" ]; then # We need a new version of cmake than travis-ci provides wget --no-check-certificate -qO - https://cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz | tar -xz # copy to a directory that will not changed every version From a995ca7b4431bf9ea0cc87251c7d41b51bb27879 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Tue, 3 May 2016 14:14:18 +0200 Subject: [PATCH 6/6] Fix typo in .travis.yml. The actual mingw compiler is set via the toolchain anyway --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d53145f35..9703ab3b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,7 @@ matrix: - gcc-mingw-w64-x86-64 - gcc-mingw-w64 - os: linux - compiler: x86_64-w64-mingw32-gcc + compiler: i686-w64-mingw32-gcc env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release addons: apt: