Arch and Draft rc files are now compiled at build time - issue #1796
This commit is contained in:
parent
8d8c727ac5
commit
75deaa658f
|
@ -509,7 +509,7 @@ else(FREECAD_LIBPACK_USE)
|
|||
#IF(NOT SMESH_FOUND)
|
||||
# MESSAGE("Salome SMESH was not found!")
|
||||
#ENDIF(NOT SMESH_FOUND)
|
||||
|
||||
|
||||
# -------------------------------- Netgen --------------------------------
|
||||
|
||||
if (BUILD_FEM_NETGEN)
|
||||
|
@ -627,6 +627,7 @@ else(FREECAD_LIBPACK_USE)
|
|||
SET(PYTHON_BASENAME -python2.7) # for PySide
|
||||
find_package(Shiboken REQUIRED)
|
||||
find_package(PySide REQUIRED)
|
||||
find_package(PySideTools REQUIRED) # Pyside utilities (pyside-uic & pyside-rcc)
|
||||
|
||||
# ------------------------------ Matplotlib ------------------------------
|
||||
|
||||
|
@ -757,7 +758,7 @@ if(FREECAD_MAINTAINERS_BUILD AND NOT WIN32)
|
|||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "python, oce | opencascade, libqtgui4, libcoin60, libxerces-c3.1, zlib1g, libboost-dev, libeigen2-dev")
|
||||
set(CPACK_PACKAGE_CONTACT "<root@localhost>")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}-${PACKAGE_VERSION}_${PKG_ARCH}")
|
||||
|
||||
|
||||
if(WIN32)
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_SOURCE_GENERATOR "ZIP")
|
||||
|
@ -845,4 +846,3 @@ if(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
endif(CMAKE_COMPILER_IS_GNUCXX OR MINGW)
|
||||
|
||||
|
|
81
cMake/FindPySideTools.cmake
Normal file
81
cMake/FindPySideTools.cmake
Normal file
|
@ -0,0 +1,81 @@
|
|||
# Try to find PySide utilities, PYSIDEUIC4 and PYSIDERCC4:
|
||||
# PYSIDEUIC4BINARY - Location of PYSIDEUIC4 executable
|
||||
# PYSIDERCC4BINARY - Location of PYSIDERCC4 executable
|
||||
# PYSIDE_TOOLS_FOUND - PySide utilities found.
|
||||
|
||||
# Also provides macro similar to FindQt4.cmake's WRAP_UI and WRAP_RC,
|
||||
# for the automatic generation of Python code from Qt4's user interface
|
||||
# ('.ui') and resource ('.qrc') files. These macros are called:
|
||||
# - PYSIDE_WRAP_UI
|
||||
# - PYSIDE_WRAP_RC
|
||||
|
||||
IF(PYSIDEUIC4BINARY AND PYSIDERCC4BINARY)
|
||||
# Already in cache, be silent
|
||||
set(PYSIDE_TOOLS_FOUND_QUIETLY TRUE)
|
||||
ENDIF(PYSIDEUIC4BINARY AND PYSIDERCC4BINARY)
|
||||
|
||||
if(WIN32)
|
||||
FIND_PROGRAM(PYSIDEUIC4BINARY pyside-uic
|
||||
HINTS ${PYSIDE_BIN_DIR}
|
||||
)
|
||||
FIND_PROGRAM(PYSIDERCC4BINARY pyside-rcc
|
||||
HINTS ${PYSIDE_BIN_DIR}
|
||||
)
|
||||
else(WIN32)
|
||||
if(APPLE)
|
||||
#set (PYTHON_BIN_DIR /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin )
|
||||
FIND_PROGRAM( PYSIDEUIC4BINARY PYSIDEUIC4
|
||||
HINTS ${PYSIDE_BIN_DIR}
|
||||
)
|
||||
FIND_PROGRAM(PYSIDERCC4BINARY PYSIDERCC4
|
||||
HINTS ${PYSIDE_BIN_DIR}
|
||||
)
|
||||
else(APPLE)
|
||||
FIND_PROGRAM(PYSIDEUIC4BINARY pyside-uic)
|
||||
FIND_PROGRAM(PYSIDERCC4BINARY pyside-rcc)
|
||||
endif(APPLE)
|
||||
endif(WIN32)
|
||||
#message(STATUS "PYSIDEUIC4BINARY ${PYSIDEUIC4BINARY}" )
|
||||
#message(STATUS "PYSIDERCC4BINARY ${PYSIDERCC4BINARY}" )
|
||||
|
||||
MACRO(PYSIDE_WRAP_UI outfiles)
|
||||
FOREACH(it ${ARGN})
|
||||
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
|
||||
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
|
||||
SET(outfile ${CMAKE_CURRENT_SOURCE_DIR}/ui_${outfile}.py)
|
||||
#ADD_CUSTOM_TARGET(${it} ALL
|
||||
# DEPENDS ${outfile}
|
||||
#)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDEUIC4BINARY} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_UI)
|
||||
|
||||
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_SOURCE_DIR}/${outfile}_rc.py)
|
||||
#ADD_CUSTOM_TARGET(${it} ALL
|
||||
# DEPENDS ${outfile}
|
||||
#)
|
||||
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
|
||||
COMMAND ${PYSIDERCC4BINARY} ${infile} -o ${outfile}
|
||||
MAIN_DEPENDENCY ${infile}
|
||||
)
|
||||
SET(${outfiles} ${${outfiles}} ${outfile})
|
||||
ENDFOREACH(it)
|
||||
ENDMACRO (PYSIDE_WRAP_RC)
|
||||
|
||||
IF(EXISTS ${PYSIDEUIC4BINARY} AND EXISTS ${PYSIDERCC4BINARY})
|
||||
set(PYSIDE_TOOLS_FOUND TRUE)
|
||||
ENDIF(EXISTS ${PYSIDEUIC4BINARY} AND EXISTS ${PYSIDERCC4BINARY})
|
||||
|
||||
if(PYSIDE_TOOLS_FOUND)
|
||||
if(NOT PYSIDE_TOOLS_FOUND_QUIETLY)
|
||||
message(STATUS "Found PySide Tools: ${PYSIDEUIC4BINARY}, ${PYSIDERCC4BINARY}")
|
||||
endif(NOT PYSIDE_TOOLS_FOUND_QUIETLY)
|
||||
endif(PYSIDE_TOOLS_FOUND)
|
File diff suppressed because one or more lines are too long
|
@ -1,12 +1,13 @@
|
|||
PYSIDE_WRAP_RC(Arch_QRC_SRCS Resources/Arch.qrc)
|
||||
|
||||
SET(Arch_SRCS
|
||||
${Arch_QRC_SRCS}
|
||||
Init.py
|
||||
InitGui.py
|
||||
ArchComponent.py
|
||||
ArchWall.py
|
||||
importIFC.py
|
||||
importIFClegacy.py
|
||||
Arch_rc.py
|
||||
Arch.py
|
||||
ArchBuilding.py
|
||||
ArchFloor.py
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
PYSIDE_WRAP_RC(Draft_QRC_SRCS Resources/Draft.qrc)
|
||||
|
||||
SET(Draft_SRCS
|
||||
${Draft_QRC_SRCS}
|
||||
Init.py
|
||||
InitGui.py
|
||||
Draft.py
|
||||
|
@ -15,7 +17,6 @@ SET(Draft_SRCS
|
|||
importSVG.py
|
||||
importDWG.py
|
||||
importAirfoilDAT.py
|
||||
Draft_rc.py
|
||||
TestDraft.py
|
||||
)
|
||||
SOURCE_GROUP("" FILES ${Draft_SRCS})
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user