diff --git a/src/Mod/Part/App/CMakeLists.txt b/src/Mod/Part/App/CMakeLists.txt index fc33a8f047..43b75e20a9 100644 --- a/src/Mod/Part/App/CMakeLists.txt +++ b/src/Mod/Part/App/CMakeLists.txt @@ -364,38 +364,10 @@ SET(Part_SRCS FaceMakerBullseye.h ) -SET(Part_Scripts - Init.py - TestPartApp.py - MakeBottle.py - JoinFeatures.py - AttachmentEditor/__init__.py - AttachmentEditor/Commands.py - AttachmentEditor/FrozenClass.py - AttachmentEditor/TaskAttachmentEditor.py - AttachmentEditor/TaskAttachmentEditor.ui - BOPTools/__init__.py - BOPTools/GeneralFuseResult.py - BOPTools/JoinAPI.py - BOPTools/JoinFeatures.py - BOPTools/ShapeMerge.py - BOPTools/SplitAPI.py - BOPTools/SplitFeatures.py - BOPTools/Utils.py - CompoundTools/__init__.py - CompoundTools/_CommandCompoundFilter.py - CompoundTools/CompoundFilter.py -) - add_library(Part SHARED ${Part_SRCS}) target_link_libraries(Part ${Part_LIBS}) -fc_target_copy_resource(Part - ${CMAKE_SOURCE_DIR}/src/Mod/Part - ${CMAKE_BINARY_DIR}/Mod/Part - ${Part_Scripts}) - SET_BIN_DIR(Part Part /Mod/Part) SET_PYTHON_PREFIX_SUFFIX(Part) diff --git a/src/Mod/Part/CMakeLists.txt b/src/Mod/Part/CMakeLists.txt index 24f97bc71c..9f4658d422 100644 --- a/src/Mod/Part/CMakeLists.txt +++ b/src/Mod/Part/CMakeLists.txt @@ -4,48 +4,85 @@ if(BUILD_GUI) add_subdirectory(Gui) endif(BUILD_GUI) +set(Part_Scripts + Init.py + JoinFeatures.py + MakeBottle.py + TestPartApp.py +) + +if(BUILD_GUI) + list (APPEND Part_Scripts + InitGui.py + TestPartGui.py + ) +endif(BUILD_GUI) + +set(AttachmentEditor_Scripts + AttachmentEditor/__init__.py + AttachmentEditor/Commands.py + AttachmentEditor/FrozenClass.py + AttachmentEditor/TaskAttachmentEditor.py + AttachmentEditor/TaskAttachmentEditor.ui +) + +set(BOPTools_Scripts + BOPTools/__init__.py + BOPTools/GeneralFuseResult.py + BOPTools/JoinAPI.py + BOPTools/JoinFeatures.py + BOPTools/ShapeMerge.py + BOPTools/SplitAPI.py + BOPTools/SplitFeatures.py + BOPTools/Utils.py +) + +set(CompoundTools_Scripts + CompoundTools/__init__.py + CompoundTools/_CommandCompoundFilter.py + CompoundTools/CompoundFilter.py +) + +add_custom_target(PartScripts ALL SOURCES + ${Part_Scripts} + ${AttachmentEditor_Scripts} + ${BOPTools_Scripts} + ${CompoundTools_Scripts} +) + +fc_target_copy_resource(PartScripts + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/Mod/Part + ${Part_Scripts} + ${AttachmentEditor_Scripts} + ${BOPTools_Scripts} + ${CompoundTools_Scripts} +) + INSTALL( FILES - Init.py - InitGui.py - MakeBottle.py - TestPartApp.py - TestPartGui.py - JoinFeatures.py + ${Part_Scripts} DESTINATION Mod/Part ) INSTALL( FILES - AttachmentEditor/__init__.py - AttachmentEditor/Commands.py - AttachmentEditor/FrozenClass.py - AttachmentEditor/TaskAttachmentEditor.py - AttachmentEditor/TaskAttachmentEditor.ui + ${AttachmentEditor_Scripts} DESTINATION Mod/Part/AttachmentEditor - ) +) INSTALL( FILES - BOPTools/__init__.py - BOPTools/GeneralFuseResult.py - BOPTools/JoinAPI.py - BOPTools/JoinFeatures.py - BOPTools/ShapeMerge.py - BOPTools/SplitAPI.py - BOPTools/SplitFeatures.py - BOPTools/Utils.py + ${BOPTools_Scripts} DESTINATION Mod/Part/BOPTools - ) +) INSTALL( FILES - CompoundTools/__init__.py - CompoundTools/_CommandCompoundFilter.py - CompoundTools/CompoundFilter.py + ${CompoundTools_Scripts} DESTINATION Mod/Part/CompoundTools - ) +) diff --git a/src/Mod/Part/Gui/CMakeLists.txt b/src/Mod/Part/Gui/CMakeLists.txt index 3bcc8c47ba..0312b08a99 100644 --- a/src/Mod/Part/Gui/CMakeLists.txt +++ b/src/Mod/Part/Gui/CMakeLists.txt @@ -253,30 +253,18 @@ SET(PartGui_SRCS TaskAttacher.cpp ) -SET(PartGui_Scripts - InitGui.py - TestPartGui.py -) - - -add_library(PartGui SHARED ${PartGui_SRCS}) -target_link_libraries(PartGui ${PartGui_LIBS}) - - -fc_target_copy_resource(PartGui - ${CMAKE_SOURCE_DIR}/src/Mod/Part - ${CMAKE_BINARY_DIR}/Mod/Part - ${PartGui_Scripts}) - -SET_BIN_DIR(PartGui PartGui /Mod/Part) -SET_PYTHON_PREFIX_SUFFIX(PartGui) - -INSTALL(TARGETS PartGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) - SET(PartGuiIcon_SVG Resources/icons/PartWorkbench.svg ) +add_library(PartGui SHARED ${PartGui_SRCS} ${PartGuiIcon_SVG}) +target_link_libraries(PartGui ${PartGui_LIBS}) + + +SET_BIN_DIR(PartGui PartGui /Mod/Part) +SET_PYTHON_PREFIX_SUFFIX(PartGui) + fc_copy_sources(PartGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Part" ${PartGuiIcon_SVG}) +INSTALL(TARGETS PartGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) INSTALL(FILES ${PartGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Part/Resources/icons")