summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-08-31 11:59:30 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-31 16:51:27 +0200
commit449d1f620aa846409495a970a3858050951c6e46 (patch)
tree1bdc394efbc7c95ae4fe2009b222b746e097a76f
parentb2ae34d9b5bf017876444fa90c4d6461bfdb4fc4 (diff)
Don't set empty CMAKE_TOOLCHAIN_FILE or CMAKE_BUILD_TYPE
The CMake Visual Studio 10 generator generates an include() for the empty CMAKE_TOOLCHAIN_FILE, causing the errors in the bug. There may be other remaining errors to cause the Windows CMake build to fail with that generator, but this patch is an improvement anyway - there is no point in setting empty strings as values for those variables. Task-number: QTBUG-27087 Change-Id: I68cce9e3dce07835db5f42777ac02d440f90f967 Reviewed-by: Brad King <brad.king@kitware.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
-rw-r--r--src/corelib/Qt5CTestMacros.cmake14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/corelib/Qt5CTestMacros.cmake b/src/corelib/Qt5CTestMacros.cmake
index 9c786c5fd0..d4a0b72987 100644
--- a/src/corelib/Qt5CTestMacros.cmake
+++ b/src/corelib/Qt5CTestMacros.cmake
@@ -1,4 +1,14 @@
+set(BUILD_OPTIONS_LIST)
+
+if (CMAKE_BUILD_TYPE)
+ list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
+endif()
+
+if (CMAKE_TOOLCHAIN_FILE)
+ list(APPEND BUILD_OPTIONS_LIST "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
+endif()
+
macro(expect_pass _dir)
string(REPLACE "(" "_" testname "${_dir}")
string(REPLACE ")" "_" testname "${testname}")
@@ -8,7 +18,7 @@ macro(expect_pass _dir)
"${CMAKE_CURRENT_BINARY_DIR}/${_dir}"
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
- --build-options "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
+ --build-options "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" ${BUILD_OPTIONS_LIST}
)
endmacro()
@@ -42,6 +52,6 @@ macro(expect_fail _dir)
"${CMAKE_CURRENT_BINARY_DIR}/failbuild/${_dir}/build"
--build-generator ${CMAKE_GENERATOR}
--build-makeprogram ${CMAKE_MAKE_PROGRAM}
- --build-options "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}" "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
+ --build-options "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" ${BUILD_OPTIONS_LIST}
)
endmacro()