summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2015-03-10 18:18:23 +0100
committerAndré Klitzing <aklitzing@gmail.com>2015-03-11 07:31:33 +0000
commitcacae82a7000041b5347e4cfa3a7b46e064260b7 (patch)
tree11fcc43c5e09d8d7298db54569fc3ed6a8c385b7
parent6272f01617e596b788ff751082504e6e0d0c7fda (diff)
CMake: Fix regression with quoted OPTIONS parameter
If a parameter contains quotes the check for "-binary" fails. Change-Id: I27148b590d85291a93f1992dfd277fb857bec6e2 Reviewed-by: Stephen Kelly <steveire@gmail.com>
-rw-r--r--src/corelib/Qt5CoreMacros.cmake2
-rw-r--r--tests/auto/cmake/test_add_resource_options/CMakeLists.txt3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/Qt5CoreMacros.cmake b/src/corelib/Qt5CoreMacros.cmake
index 95102be108..a94caf0d25 100644
--- a/src/corelib/Qt5CoreMacros.cmake
+++ b/src/corelib/Qt5CoreMacros.cmake
@@ -269,7 +269,7 @@ function(QT5_ADD_RESOURCES outfiles )
set(rcc_files ${_RCC_UNPARSED_ARGUMENTS})
set(rcc_options ${_RCC_OPTIONS})
- if(${rcc_options} MATCHES "-binary")
+ if("${rcc_options}" MATCHES "-binary")
message(WARNING "Use qt5_add_binary_resources for binary option")
endif()
diff --git a/tests/auto/cmake/test_add_resource_options/CMakeLists.txt b/tests/auto/cmake/test_add_resource_options/CMakeLists.txt
index a358094546..5fcae59dfe 100644
--- a/tests/auto/cmake/test_add_resource_options/CMakeLists.txt
+++ b/tests/auto/cmake/test_add_resource_options/CMakeLists.txt
@@ -20,6 +20,9 @@ qt5_wrap_cpp(moc_files myobject.h)
# in the add_executable call.
qt5_add_resources(rcc_files "test_macro_options.qrc" OPTIONS -binary)
+# Test if OPTIONS can handle a quoted parameter. CMake would fail immediately!
+qt5_add_resources(rcc_files_quoted_option "test_macro_options.qrc" OPTIONS -root "/")
+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Core_EXECUTABLE_COMPILE_FLAGS}")
add_executable(myobject myobject.cpp ${moc_files} ${rcc_files})