diff --git a/src/Mod/PartDesign/App/CMakeLists.txt b/src/Mod/PartDesign/App/CMakeLists.txt index c9e223cfc8..5f62acef75 100644 --- a/src/Mod/PartDesign/App/CMakeLists.txt +++ b/src/Mod/PartDesign/App/CMakeLists.txt @@ -127,7 +127,6 @@ SET(Python_SRCS BodyPyImp.cpp FeaturePy.xml FeaturePyImp.cpp - ) SOURCE_GROUP("Python" FILES ${Python_SRCS}) @@ -138,58 +137,13 @@ SET(PartDesign_SRCS ${FeaturesSketchBased_SRCS} ${FeaturesDressUp_SRCS} ${Module_SRCS} - ${Python_SRCS} -) - -SET(PartDesign_Scripts - __init__.py - Init.py - TestPartDesignApp.py - InvoluteGearFeature.py - InvoluteGearFeature.ui - Scripts/__init__.py - Scripts/Gear.py - Scripts/DistanceBolt.py - Scripts/Epitrochoid.py - Scripts/FilletArc.py - Scripts/RadialCopy.py - Scripts/Parallelepiped.py - Scripts/Spring.py - PartDesignTests/__init__.py - PartDesignTests/TestDatum.py - PartDesignTests/TestShapeBinder.py - PartDesignTests/TestPad.py - PartDesignTests/TestPocket.py - PartDesignTests/TestHole.py - PartDesignTests/TestRevolve.py - PartDesignTests/TestLoft.py - PartDesignTests/TestPipe.py - PartDesignTests/TestPrimitive.py - PartDesignTests/TestMirrored.py - PartDesignTests/TestLinearPattern.py - PartDesignTests/TestPolarPattern.py - PartDesignTests/TestMultiTransform.py - PartDesignTests/TestBoolean.py - PartDesignTests/TestFillet.py - PartDesignTests/TestChamfer.py - PartDesignTests/TestDraft.py - PartDesignTests/TestThickness.py - fcgear/__init__.py - fcgear/fcgear.py - fcgear/fcgeardialog.py - fcgear/involute.py - fcgear/svggear.py + ${Python_SRCS} ) add_library(PartDesign SHARED ${PartDesign_SRCS}) target_link_libraries(PartDesign ${PartDesign_LIBS}) -fc_target_copy_resource(PartDesign - ${CMAKE_SOURCE_DIR}/src/Mod/PartDesign - ${CMAKE_BINARY_DIR}/Mod/PartDesign - ${PartDesign_Scripts}) - SET_BIN_DIR(PartDesign _PartDesign /Mod/PartDesign) SET_PYTHON_PREFIX_SUFFIX(PartDesign) diff --git a/src/Mod/PartDesign/CMakeLists.txt b/src/Mod/PartDesign/CMakeLists.txt index 4beafbfa1e..177550408a 100644 --- a/src/Mod/PartDesign/CMakeLists.txt +++ b/src/Mod/PartDesign/CMakeLists.txt @@ -4,65 +4,113 @@ if(BUILD_GUI) add_subdirectory(Gui) endif(BUILD_GUI) +set(PartDesign_Scripts + __init__.py + Init.py + TestPartDesignApp.py +) + +if(BUILD_GUI) + list (APPEND PartDesign_Scripts + InitGui.py + TestPartDesignGui.py + InvoluteGearFeature.py + InvoluteGearFeature.ui + ) +endif(BUILD_GUI) + +set(PartDesign_OtherScripts + Scripts/__init__.py + Scripts/DistanceBolt.py + Scripts/Epitrochoid.py + Scripts/FilletArc.py + Scripts/Gear.py + Scripts/Parallelepiped.py + Scripts/RadialCopy.py + Scripts/Spring.py +) + +set(PartDesign_TestScripts + PartDesignTests/__init__.py + PartDesignTests/TestDatum.py + PartDesignTests/TestShapeBinder.py + PartDesignTests/TestPad.py + PartDesignTests/TestPocket.py + PartDesignTests/TestHole.py + PartDesignTests/TestRevolve.py + PartDesignTests/TestLoft.py + PartDesignTests/TestPipe.py + PartDesignTests/TestPrimitive.py + PartDesignTests/TestMirrored.py + PartDesignTests/TestLinearPattern.py + PartDesignTests/TestPolarPattern.py + PartDesignTests/TestMultiTransform.py + PartDesignTests/TestBoolean.py + PartDesignTests/TestFillet.py + PartDesignTests/TestChamfer.py + PartDesignTests/TestDraft.py + PartDesignTests/TestThickness.py +) + +set(PartDesign_GearScripts + fcgear/__init__.py + fcgear/fcgear.py + fcgear/fcgeardialog.py + fcgear/involute.py + fcgear/svggear.py +) + +set(PartDesign_WizardShaft + WizardShaft/__init__.py + WizardShaft/WizardShaft.svg + WizardShaft/WizardShaft.py + WizardShaft/WizardShaftTable.py + WizardShaft/Shaft.py + WizardShaft/ShaftFeature.py + WizardShaft/ShaftDiagram.py + WizardShaft/SegmentFunction.py +) + +add_custom_target(PartDesignScripts ALL SOURCES + ${PartDesign_Scripts} + ${PartDesign_OtherScripts} + ${PartDesign_TestScripts} + ${PartDesign_GearScripts} +) + +fc_target_copy_resource(PartDesignScripts + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/Mod/PartDesign + ${PartDesign_Scripts} + ${PartDesign_OtherScripts} + ${PartDesign_TestScripts} + ${PartDesign_GearScripts} +) + INSTALL( FILES - __init__.py - Init.py - InitGui.py - TestPartDesignApp.py - TestPartDesignGui.py - InvoluteGearFeature.py - InvoluteGearFeature.ui + ${PartDesign_Scripts} DESTINATION Mod/PartDesign ) INSTALL( FILES - Scripts/__init__.py - Scripts/DistanceBolt.py - Scripts/Epitrochoid.py - Scripts/FilletArc.py - Scripts/Gear.py - Scripts/Parallelepiped.py - Scripts/RadialCopy.py - Scripts/Spring.py + ${PartDesign_OtherScripts} DESTINATION Mod/PartDesign/Scripts ) INSTALL( FILES - PartDesignTests/__init__.py - PartDesignTests/TestDatum.py - PartDesignTests/TestShapeBinder.py - PartDesignTests/TestPad.py - PartDesignTests/TestPocket.py - PartDesignTests/TestHole.py - PartDesignTests/TestRevolve.py - PartDesignTests/TestLoft.py - PartDesignTests/TestPipe.py - PartDesignTests/TestPrimitive.py - PartDesignTests/TestMirrored.py - PartDesignTests/TestLinearPattern.py - PartDesignTests/TestPolarPattern.py - PartDesignTests/TestMultiTransform.py - PartDesignTests/TestBoolean.py - PartDesignTests/TestFillet.py - PartDesignTests/TestChamfer.py - PartDesignTests/TestDraft.py - PartDesignTests/TestThickness.py + ${PartDesign_TestScripts} DESTINATION Mod/PartDesign/PartDesignTests ) INSTALL( FILES - fcgear/__init__.py - fcgear/fcgear.py - fcgear/fcgeardialog.py - fcgear/involute.py - fcgear/svggear.py + ${PartDesign_GearScripts} DESTINATION Mod/PartDesign/fcgear @@ -70,14 +118,7 @@ INSTALL( if(BUILD_FEM) SET(WizardShaft_SRCS - WizardShaft/__init__.py - WizardShaft/WizardShaft.svg - WizardShaft/WizardShaft.py - WizardShaft/WizardShaftTable.py - WizardShaft/Shaft.py - WizardShaft/ShaftFeature.py - WizardShaft/ShaftDiagram.py - WizardShaft/SegmentFunction.py + ${PartDesign_WizardShaft} ) SOURCE_GROUP("wizardshaft" FILES ${WizardShaft_SRCS}) @@ -115,18 +156,3 @@ SET(FeatureHole_UI ) SET(all_featurehole_files ${FeatureHole_SRCS} ${FeatureHole_UI}) - -#ADD_CUSTOM_TARGET(FeatureHole ALL -# SOURCES ${all_featurehole_files} -#) - -#SET(all_files ${all_featurehole_files}) - -#fc_copy_sources(FeatureHole "${CMAKE_BINARY_DIR}/Mod/PartDesign" ${all_files}) - -#INSTALL( -# FILES -# ${FeatureHole_SRCS} -# DESTINATION -# Mod/PartDesign/FeatureHole -#) diff --git a/src/Mod/PartDesign/Gui/CMakeLists.txt b/src/Mod/PartDesign/Gui/CMakeLists.txt index fcb61e2489..78969402fd 100644 --- a/src/Mod/PartDesign/Gui/CMakeLists.txt +++ b/src/Mod/PartDesign/Gui/CMakeLists.txt @@ -265,38 +265,26 @@ SET(Python_SRCS SOURCE_GROUP("Python" FILES ${Python_SRCS}) -SET(PartDesignGui_Scripts - InitGui.py - TestPartDesignGui.py -) - SET(PartDesignGui_SRCS ${PartDesignGui_SRCS} ${PartDesignGui_UIC_HDRS} ${PartDesignGuiModule_SRCS} ${PartDesignGuiTaskDlgs_SRCS} ${PartDesignGuiViewProvider_SRCS} - ${Python_SRCS} + ${Python_SRCS} ) -add_library(PartDesignGui SHARED ${PartDesignGui_SRCS}) -target_link_libraries(PartDesignGui ${PartDesignGui_LIBS}) - - -fc_target_copy_resource(PartDesignGui - ${CMAKE_SOURCE_DIR}/src/Mod/PartDesign - ${CMAKE_BINARY_DIR}/Mod/PartDesign - ${PartDesignGui_Scripts}) - -SET_BIN_DIR(PartDesignGui PartDesignGui /Mod/PartDesign) -SET_PYTHON_PREFIX_SUFFIX(PartDesignGui) - -INSTALL(TARGETS PartDesignGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) - SET(PartDesignGuiIcon_SVG Resources/icons/PartDesignWorkbench.svg ) +add_library(PartDesignGui SHARED ${PartDesignGui_SRCS} ${PartDesignGuiIcon_SVG}) +target_link_libraries(PartDesignGui ${PartDesignGui_LIBS}) + +SET_BIN_DIR(PartDesignGui PartDesignGui /Mod/PartDesign) +SET_PYTHON_PREFIX_SUFFIX(PartDesignGui) + fc_copy_sources(PartDesignGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/PartDesign" ${PartDesignGuiIcon_SVG}) +INSTALL(TARGETS PartDesignGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) INSTALL(FILES ${PartDesignGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/PartDesign/Resources/icons")