diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-08-31 11:59:30 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-31 16:51:27 +0200 |
commit | 449d1f620aa846409495a970a3858050951c6e46 (patch) | |
tree | 1bdc394efbc7c95ae4fe2009b222b746e097a76f /src/corelib/Qt5CTestMacros.cmake | |
parent | Doc: More fixes of qdoc-reported doc errors (diff) | |
download | qtbase-449d1f620aa846409495a970a3858050951c6e46.tar.xz qtbase-449d1f620aa846409495a970a3858050951c6e46.zip |
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>
Diffstat (limited to 'src/corelib/Qt5CTestMacros.cmake')
-rw-r--r-- | src/corelib/Qt5CTestMacros.cmake | 14 |
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() |