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>
This commit is contained in:
André Klitzing 2015-03-10 18:18:23 +01:00
parent 6272f01617
commit cacae82a70
2 changed files with 4 additions and 1 deletions

View File

@ -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()

View File

@ -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})