From c44ade6961c39009dee34f61491f27ccf8b81852 Mon Sep 17 00:00:00 2001 From: Peter Lama Date: Tue, 14 Aug 2018 19:47:23 -0700 Subject: [PATCH] Fix build error on MacOS due to sed command usage Non GNU sed on macOS expects suffix after -i option (can be empty str). However, removing the comments from the pyside generated files is not a necessary operation (presumably done to avoid a diff when no code changed), so simply skip the operation on macOS --- cMake/FindPySide2Tools.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cMake/FindPySide2Tools.cmake b/cMake/FindPySide2Tools.cmake index a8894cdfc8..9c97514888 100644 --- a/cMake/FindPySide2Tools.cmake +++ b/cMake/FindPySide2Tools.cmake @@ -31,12 +31,12 @@ MACRO(PYSIDE_WRAP_UI outfiles) #ADD_CUSTOM_TARGET(${it} ALL # DEPENDS ${outfile} #) - if(WIN32) + if(WIN32 OR APPLE) ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND ${PYSIDE2UICBINARY} ${infile} -o ${outfile} MAIN_DEPENDENCY ${infile} ) - else(WIN32) + else() # Especially on Open Build Service we don't want changing date like # pyside2-uic generates in comments at beginning., which is why # we follow the tool command with in-place sed. @@ -45,7 +45,7 @@ MACRO(PYSIDE_WRAP_UI outfiles) COMMAND sed -i "/^# /d" "${outfile}" MAIN_DEPENDENCY "${infile}" ) - endif(WIN32) + endif() list(APPEND ${outfiles} ${outfile}) ENDFOREACH(it) ENDMACRO (PYSIDE_WRAP_UI) @@ -58,12 +58,12 @@ MACRO(PYSIDE_WRAP_RC outfiles) #ADD_CUSTOM_TARGET(${it} ALL # DEPENDS ${outfile} #) - if(WIN32) + if(WIN32 OR APPLE) ADD_CUSTOM_COMMAND(OUTPUT ${outfile} COMMAND ${PYSIDE2RCCBINARY} ${infile} -o ${outfile} MAIN_DEPENDENCY ${infile} ) - else(WIN32) + else() # Especially on Open Build Service we don't want changing date like # pyside-rcc generates in comments at beginning, which is why # we follow the tool command with in-place sed. @@ -72,7 +72,7 @@ MACRO(PYSIDE_WRAP_RC outfiles) COMMAND sed -i "/^# /d" "${outfile}" MAIN_DEPENDENCY "${infile}" ) - endif(WIN32) + endif() list(APPEND ${outfiles} ${outfile}) ENDFOREACH(it) ENDMACRO (PYSIDE_WRAP_RC)