Skip to content

Commit

Permalink
Fix macro invoking moc, rcc and uic
Browse files Browse the repository at this point in the history
* Otherwise the arguments aren't passed correctly leading to errors like
  ```
  [  3%] Generating qca_core.moc
  moc: Too many input files specified: 'Qt5::moc' '/build/qca-qt5/src/qca-2.1.3/include/QtCrypto/qca_safetimer.h'
  ```
* Just a workaround, not sure what is causing the issue (maybe a CMake bug?)
* See Martchus/PKGBUILDs#11

Change-Id: I6fde86d0a3ade37b4376604a1eb6d5723eda8b4c
  • Loading branch information
Martchus authored and Marius Kittler committed Apr 19, 2017
1 parent 2d7fb71 commit 4c840dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/corelib/Qt5CoreMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ function(QT5_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target
endif()

set(_moc_extra_parameters_file @${_moc_parameters_file})
get_target_property(MOC_LOC ${Qt5Core_MOC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_MOC_EXECUTABLE} ${_moc_extra_parameters_file}
COMMAND ${MOC_LOC} ${_moc_extra_parameters_file}
DEPENDS ${infile} ${moc_depends}
${_moc_working_dir}
VERBATIM)
Expand Down Expand Up @@ -251,8 +252,9 @@ function(QT5_ADD_BINARY_RESOURCES target )
set(rc_depends ${rc_depends} ${_rc_depends})
endforeach()

get_target_property(RCC_LOC ${Qt5Core_RCC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${rcc_destination}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
COMMAND ${RCC_LOC}
ARGS ${rcc_options} --binary --name ${target} --output ${rcc_destination} ${infiles}
DEPENDS ${rc_depends} ${out_depends} VERBATIM)

Expand Down Expand Up @@ -284,8 +286,9 @@ function(QT5_ADD_RESOURCES outfiles )

_QT5_PARSE_QRC_FILE(${infile} _out_depends _rc_depends)

get_target_property(MOC_LOC ${Qt5Core_RCC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Core_RCC_EXECUTABLE}
COMMAND ${MOC_LOC}
ARGS ${rcc_options} --name ${outfilename} --output ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_rc_depends} "${out_depends}" VERBATIM)
Expand Down
3 changes: 2 additions & 1 deletion src/widgets/Qt5WidgetsMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ function(QT5_WRAP_UI outfiles )
get_filename_component(outfile ${it} NAME_WE)
get_filename_component(infile ${it} ABSOLUTE)
set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h)
get_target_property(UIC_LOC ${Qt5Widgets_UIC_EXECUTABLE} IMPORTED_LOCATION)
add_custom_command(OUTPUT ${outfile}
COMMAND ${Qt5Widgets_UIC_EXECUTABLE}
COMMAND ${UIC_LOC}
ARGS ${ui_options} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile} VERBATIM)
list(APPEND ${outfiles} ${outfile})
Expand Down

0 comments on commit 4c840dc

Please sign in to comment.