From 5f8f26824486b55b2bf72c579e95f0f6d4a19284 Mon Sep 17 00:00:00 2001 From: Ryan Pavlik Date: Fri, 15 Jun 2018 13:44:28 -0500 Subject: [PATCH] Apply equivalent changes to FindPySide2Tools as FindPySideTools. These are largely matching files, potential to de-duplicate them, but this just ports the changes over for now. --- cMake/FindPySide2Tools.cmake | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cMake/FindPySide2Tools.cmake b/cMake/FindPySide2Tools.cmake index 8904404313..a8894cdfc8 100644 --- a/cMake/FindPySide2Tools.cmake +++ b/cMake/FindPySide2Tools.cmake @@ -38,14 +38,15 @@ MACRO(PYSIDE_WRAP_UI outfiles) ) else(WIN32) # Especially on Open Build Service we don't want changing date like - # pyside2-uic generates in comments at beginning. - EXECUTE_PROCESS( - COMMAND ${PYSIDE2UICBINARY} ${infile} - COMMAND sed "/^# /d" - OUTPUT_FILE ${outfile} + # pyside2-uic generates in comments at beginning., which is why + # we follow the tool command with in-place sed. + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND "${PYSIDE2UICBINARY}" "${infile}" -o "${outfile}" + COMMAND sed -i "/^# /d" "${outfile}" + MAIN_DEPENDENCY "${infile}" ) endif(WIN32) - SET(${outfiles} ${${outfiles}} ${outfile}) + list(APPEND ${outfiles} ${outfile}) ENDFOREACH(it) ENDMACRO (PYSIDE_WRAP_UI) @@ -53,7 +54,7 @@ MACRO(PYSIDE_WRAP_RC outfiles) FOREACH(it ${ARGN}) GET_FILENAME_COMPONENT(outfile ${it} NAME_WE) GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE) - SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py) + SET(outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py") #ADD_CUSTOM_TARGET(${it} ALL # DEPENDS ${outfile} #) @@ -64,14 +65,15 @@ MACRO(PYSIDE_WRAP_RC outfiles) ) else(WIN32) # Especially on Open Build Service we don't want changing date like - # pyside2-rcc generates in comments at beginning. - EXECUTE_PROCESS( - COMMAND ${PYSIDE2RCCBINARY} ${infile} - COMMAND sed "/^# /d" - OUTPUT_FILE ${outfile} - ) + # pyside-rcc generates in comments at beginning, which is why + # we follow the tool command with in-place sed. + ADD_CUSTOM_COMMAND(OUTPUT "${outfile}" + COMMAND "${PYSIDE2RCCBINARY}" "${infile}" ${PY_ATTRIBUTE} -o "${outfile}" + COMMAND sed -i "/^# /d" "${outfile}" + MAIN_DEPENDENCY "${infile}" + ) endif(WIN32) - SET(${outfiles} ${${outfiles}} ${outfile}) + list(APPEND ${outfiles} ${outfile}) ENDFOREACH(it) ENDMACRO (PYSIDE_WRAP_RC)