Build python Qt resource files at compile time

fixes #1888
This commit is contained in:
Sebastian Hoogen 2015-01-02 11:14:07 +01:00 committed by wmayer
parent f3af41e4cc
commit a8dd528c1a
8 changed files with 36 additions and 95 deletions

View File

@ -1,3 +1,4 @@
PYSIDE_WRAP_RC(Material_QRC_SRCS Resources/Material.qrc)
SET(Material_SRCS
Init.py
@ -21,7 +22,7 @@ SET (MaterialLib_Files
SOURCE_GROUP("MatLib" FILES ${MaterialLib_Files})
ADD_CUSTOM_TARGET(Material ALL
SOURCES ${Material_SRCS}
SOURCES ${Material_SRCS} ${Material_QRC_SRCS}
)
fc_target_copy_resource(Material
@ -29,6 +30,11 @@ fc_target_copy_resource(Material
${CMAKE_BINARY_DIR}/Mod/Material
${Material_SRCS})
fc_target_copy_resource(Material
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/Mod/Material
Material_rc.py)
ADD_CUSTOM_TARGET(MaterialLib ALL
SOURCES ${MaterialLib_Files}
)
@ -41,7 +47,7 @@ fc_target_copy_resource(MaterialLib
${MaterialLib_Files})
INSTALL(
FILES ${Material_SRCS}
FILES ${Material_SRCS} ${Material_QRC_SRCS}
DESTINATION Mod/Material
)

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,9 @@
PYSIDE_WRAP_RC(Plot_QRC_SRCS resources/Plot.qrc)
SET(PlotMain_SRCS
Plot.py
InitGui.py
PlotGui.py
Plot_rc.py
)
SOURCE_GROUP("" FILES ${PlotMain_SRCS})
@ -50,11 +51,16 @@ SOURCE_GROUP("plotutils" FILES ${PlotUtils_SRCS})
SET(all_files ${PlotMain_SRCS} ${PlotAxes_SRCS} ${PlotLabels_SRCS} ${PlotPositions_SRCS} ${PlotSave_SRCS} ${PlotSeries_SRCS} ${PlotUtils_SRCS})
ADD_CUSTOM_TARGET(Plot ALL
SOURCES ${all_files}
SOURCES ${all_files} ${Plot_QRC_SRCS}
)
fc_copy_sources(Plot "${CMAKE_BINARY_DIR}/Mod/Plot" ${all_files})
fc_target_copy_resource(Plot
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/Mod/Plot
Plot_rc.py)
INSTALL(
FILES
${PlotAxes_SRCS}
@ -94,6 +100,7 @@ INSTALL(
INSTALL(
FILES
${PlotMain_SRCS}
${Plot_QRC_SRCS}
DESTINATION
Mod/Plot
)

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,9 @@
PYSIDE_WRAP_RC(Ship_QRC_SRCS resources/Ship.qrc)
SET(ShipMain_SRCS
InitGui.py
ShipGui.py
Instance.py
Ship_rc.py
TankInstance.py
WeightInstance.py
)
@ -91,11 +92,16 @@ SOURCE_GROUP("shiputils" FILES ${ShipUtils_SRCS})
SET(all_files ${ShipMain_SRCS} ${ShipExamples_SRCS} ${ShipLoadExample_SRCS} ${ShipCreateShip_SRCS} ${ShipOutlineDraw_SRCS} ${ShipAreasCurve_SRCS} ${ShipHydrostatics_SRCS} ${ShipCreateWeight_SRCS} ${ShipCreateTank_SRCS} ${ShipCapacityCurve_SRCS} ${ShipUtils_SRCS})
ADD_CUSTOM_TARGET(Ship ALL
SOURCES ${all_files}
SOURCES ${all_files} ${Ship_QRC_SRCS}
)
fc_copy_sources(Ship "${CMAKE_BINARY_DIR}/Mod/Ship" ${all_files})
fc_target_copy_resource(Ship
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/Mod/Ship
Ship_rc.py)
INSTALL(
FILES
${ShipExamples_SRCS}
@ -159,6 +165,7 @@ INSTALL(
INSTALL(
FILES
${ShipMain_SRCS}
${Ship_QRC_SRCS}
DESTINATION
Mod/Ship
)

File diff suppressed because one or more lines are too long

View File

@ -1,21 +1,26 @@
PYSIDE_WRAP_RC(Spreadsheet_QRC_SRCS Resources/Spreadsheet.qrc)
SET(Spreadsheet_SRCS
Init.py
InitGui.py
Spreadsheet.py
Spreadsheet_rc.py
)
SOURCE_GROUP("" FILES ${Spreadsheet_SRCS})
SET(all_files ${Spreadsheet_SRCS})
ADD_CUSTOM_TARGET(Spreadsheet ALL
SOURCES ${all_files}
SOURCES ${all_files} ${Spreadsheet_QRC_SRCS}
)
fc_copy_sources(Spreadsheet "${CMAKE_BINARY_DIR}/Mod/Spreadsheet" ${all_files})
fc_target_copy_resource(Spreadsheet
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/Mod/Spreadsheet
Spreadsheet_rc.py)
INSTALL(
FILES ${Spreadsheet_SRCS}
FILES ${Spreadsheet_SRCS} ${Spreadsheet_QRC_SRCS}
DESTINATION Mod/Spreadsheet
)

File diff suppressed because one or more lines are too long