From 2b9da837d79b80bbad546e8753ba7f021e5c7315 Mon Sep 17 00:00:00 2001 From: Johannes Obermayr Date: Fri, 23 Jan 2015 21:22:59 +0100 Subject: [PATCH] Avoid build time on generated files from pyside-rcc and pyside-uic. Fixes build compare: [ 3218s] RPM file checksum differs. [ 3218s] Extracting packages [ 3232s] /usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py differs (Python script, ASCII text executable, with very long lines) [ 3232s] --- old//usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py2015-01-21 20:26:34.000000000 +0000 [ 3232s] +++ new//usr/lib64/FreeCAD/Mod/Arch/Arch_rc.py2015-01-23 11:41:24.000000000 +0000 [ 3232s] @@ -2,7 +2,7 @@ [ 3232s] [ 3232s] # Resource object code [ 3232s] # [ 3232s] -# Created: Wed Jan 21 20:26:34 2015 [ 3232s] +# Created: Fri Jan 23 11:41:24 2015 [ 3232s] # by: The Resource Compiler for PySide (Qt v4.8.4) [ 3232s] # [ 3232s] # WARNING! All changes made in this file will be lost! --- cMake/FindPySideTools.cmake | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/cMake/FindPySideTools.cmake b/cMake/FindPySideTools.cmake index 053cb93e0..2d3e88bc3 100644 --- a/cMake/FindPySideTools.cmake +++ b/cMake/FindPySideTools.cmake @@ -31,10 +31,20 @@ MACRO(PYSIDE_WRAP_UI outfiles) #ADD_CUSTOM_TARGET(${it} ALL # DEPENDS ${outfile} #) - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile} - MAIN_DEPENDENCY ${infile} - ) + if(WIN32) + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile} + MAIN_DEPENDENCY ${infile} + ) + else(WIN32) + # Especially on Open Build Service we don't want changing date like + # pyside-uic generates in comments at beginning. + EXECUTE_PROCESS( + COMMAND ${PYSIDEUIC4BINARY} ${infile} + COMMAND sed "/^# /d" + OUTPUT_FILE ${outfile} + ) + endif(WIN32) SET(${outfiles} ${${outfiles}} ${outfile}) ENDFOREACH(it) ENDMACRO (PYSIDE_WRAP_UI) @@ -47,10 +57,20 @@ MACRO(PYSIDE_WRAP_RC outfiles) #ADD_CUSTOM_TARGET(${it} ALL # DEPENDS ${outfile} #) - ADD_CUSTOM_COMMAND(OUTPUT ${outfile} - COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile} - MAIN_DEPENDENCY ${infile} - ) + if(WIN32) + ADD_CUSTOM_COMMAND(OUTPUT ${outfile} + COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile} + MAIN_DEPENDENCY ${infile} + ) + else(WIN32) + # Especially on Open Build Service we don't want changing date like + # pyside-rcc generates in comments at beginning. + EXECUTE_PROCESS( + COMMAND ${PYSIDERCC4BINARY} ${infile} + COMMAND sed "/^# /d" + OUTPUT_FILE ${outfile} + ) + endif(WIN32) SET(${outfiles} ${${outfiles}} ${outfile}) ENDFOREACH(it) ENDMACRO (PYSIDE_WRAP_RC)