From f3d6d3a8f2bb675c5c6a636fd6cc989a213df46c Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Wed, 4 May 2016 00:51:28 +0200 Subject: [PATCH] Fix find-package-test failure with non-default compiler The failure would happen when the main project was configured with a compiler which is not the system default. The new configuration was not forwarded to "ctest --build-and-test". This fixes it. --- test/CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 3506b461..c329749b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -137,8 +137,10 @@ if (FMT_PEDANTIC) "${CMAKE_CURRENT_BINARY_DIR}/find-package-test" --build-generator ${CMAKE_GENERATOR} --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-options "-DFMT_DIR=${PROJECT_BINARY_DIR}" - "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") + --build-options + "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" + "-DFMT_DIR=${PROJECT_BINARY_DIR}" + "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") # test if the targets are findable when add_subdirectory is used add_test(add-subdirectory-test ${CMAKE_CTEST_COMMAND} @@ -148,5 +150,7 @@ if (FMT_PEDANTIC) "${CMAKE_CURRENT_BINARY_DIR}/add-subdirectory-test" --build-generator ${CMAKE_GENERATOR} --build-makeprogram ${CMAKE_MAKE_PROGRAM} - --build-options "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") + --build-options + "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" + "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}") endif ()