diff options
Diffstat (limited to 'Modules/Qt4Macros.cmake')
-rw-r--r-- | Modules/Qt4Macros.cmake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 5ada030..8c4daac 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -65,8 +65,8 @@ macro (QT4_MAKE_OUTPUT_FILE infile prefix ext outfile ) else() file(RELATIVE_PATH rel ${CMAKE_CURRENT_SOURCE_DIR} ${infile}) endif() - if(WIN32 AND rel MATCHES "^[a-zA-Z]:") # absolute path - string(REGEX REPLACE "^([a-zA-Z]):(.*)$" "\\1_\\2" rel "${rel}") + if(WIN32 AND rel MATCHES "^([a-zA-Z]):(.*)$") # absolute path + set(rel "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}") endif() set(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${rel}") string(REPLACE ".." "__" _outfile ${_outfile}) @@ -135,13 +135,15 @@ function (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target set(targetincludes) set(targetdefines) else() - file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n") + set(CMAKE_CONFIGURABLE_FILE_CONTENT "${_moc_parameters}") + configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" + "${_moc_parameters_file}" @ONLY) endif() set(_moc_extra_parameters_file @${_moc_parameters_file}) add_custom_command(OUTPUT ${outfile} COMMAND Qt4::moc ${_moc_extra_parameters_file} - DEPENDS ${infile} + DEPENDS ${infile} ${_moc_parameters_file} ${_moc_working_dir} VERBATIM) endfunction () |