From bedc26804aec45060dda2290be837d5fc2d76ce1 Mon Sep 17 00:00:00 2001 From: Uwe Date: Mon, 21 Mar 2022 02:44:01 +0100 Subject: [PATCH] [Assembly] remove Python.h and Xerces --- src/Mod/Assembly/App/AppAssembly.cpp | 5 - src/Mod/Assembly/App/AppAssemblyPy.cpp | 4 - src/Mod/Assembly/App/CMakeLists.txt | 249 +++++++++++----------- src/Mod/Assembly/App/PreCompiled.h | 3 - src/Mod/Assembly/Gui/AppAssemblyGui.cpp | 4 - src/Mod/Assembly/Gui/AppAssemblyGuiPy.cpp | 4 - src/Mod/Assembly/Gui/CMakeLists.txt | 243 +++++++++++---------- src/Mod/Assembly/Gui/PreCompiled.h | 3 - 8 files changed, 245 insertions(+), 270 deletions(-) diff --git a/src/Mod/Assembly/App/AppAssembly.cpp b/src/Mod/Assembly/App/AppAssembly.cpp index 15703cc430..3878b3c44c 100644 --- a/src/Mod/Assembly/App/AppAssembly.cpp +++ b/src/Mod/Assembly/App/AppAssembly.cpp @@ -20,12 +20,7 @@ * * ***************************************************************************/ - #include "PreCompiled.h" -#ifndef _PreComp_ -# include -//# include -#endif #include #include diff --git a/src/Mod/Assembly/App/AppAssemblyPy.cpp b/src/Mod/Assembly/App/AppAssemblyPy.cpp index 5171d0843f..46661a7d9d 100644 --- a/src/Mod/Assembly/App/AppAssemblyPy.cpp +++ b/src/Mod/Assembly/App/AppAssemblyPy.cpp @@ -20,11 +20,7 @@ * * ***************************************************************************/ - #include "PreCompiled.h" -#ifndef _PreComp_ -# include -#endif #include #include diff --git a/src/Mod/Assembly/App/CMakeLists.txt b/src/Mod/Assembly/App/CMakeLists.txt index 5640dc2b12..f291823c92 100644 --- a/src/Mod/Assembly/App/CMakeLists.txt +++ b/src/Mod/Assembly/App/CMakeLists.txt @@ -1,125 +1,124 @@ -if(MSVC) - add_definitions(-DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) -else(MSVC) - add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) -endif(MSVC) - -add_definitions(-DBOOST_${Boost_VERSION}) - -include_directories( - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_BINARY_DIR}/src - ${CMAKE_SOURCE_DIR}/src/Mod/Assembly/App - ${CMAKE_CURRENT_BINARY_DIR} - ${Boost_INCLUDE_DIRS} - ${OCC_INCLUDE_DIR} - ${PYTHON_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIR} - ${XercesC_INCLUDE_DIRS} - #${ODE_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIR} - -) - -link_directories(${OCC_LIBRARY_DIR}) - -set(Assembly_LIBS - #${ODE_LIBRARIES} - ${OCC_LIBRARIES} - ${Boost_LIBRARIES} - ${Boost_LOG_LIBRARY_RELEASE} - Part - FreeCADApp -) - -generate_from_xml(ItemPy) -generate_from_xml(ProductRefPy) -#generate_from_xml(PartRefPy) -generate_from_xml(ConstraintPy) -generate_from_xml(ConstraintGroupPy) - -SET(Features_SRCS - Item.cpp - Item.h - #PartRef.cpp - #PartRef.h - Product.cpp - Product.h - ProductRef.cpp - ProductRef.h - Constraint.cpp - Constraint.h - ConstraintGroup.cpp - ConstraintGroup.h -) -SOURCE_GROUP("Features" FILES ${Features_SRCS}) - -SET(Module_SRCS - AppAssembly.cpp - AppAssemblyPy.cpp - PreCompiled.cpp - PreCompiled.h -) -SOURCE_GROUP("Module" FILES ${Module_SRCS}) - -#externalization is not possible for msvc as a stupid bug prevents the function definition resolving -if(MSVC) - set(Solver_SRC ) -else(MSVC) - set(Solver_SRC Solver/solver_3d_ext1.cpp - Solver/solver_3d_ext2.cpp - Solver/solver_3d_ext3.cpp - ) - - if(FREECAD_ASSEMBLY_DEBUG_FACILITIES) - set(Solver_SRC ${Solver_SRC} - Solver/solver_state_ext1.cpp - Solver/solver_state_ext2.cpp - ) - endif(FREECAD_ASSEMBLY_DEBUG_FACILITIES) -endif(MSVC) - -SOURCE_GROUP("Solver" FILES ${Solver_SRC}) - -SET(Python_SRCS - ItemPy.xml - ItemPyImp.cpp - ProductRefPy.xml - ProductRefPyImp.cpp - #PartRefPy.xml - #PartRefPyImp.cpp - ConstraintPy.xml - ConstraintPyImp.cpp - ConstraintGroupPy.xml - ConstraintGroupPyImp.cpp -) -SOURCE_GROUP("Python" FILES ${Python_SRCS}) - -SET(Assembly_SRCS - ${Features_SRCS} - ${Python_SRCS} - ${Module_SRCS} - ${Solver_SRC} -) - -SET(Assembly_Scripts - ../Init.py - ../AssemblyLib.py -) - -add_library(Assembly SHARED ${Assembly_SRCS} ${Assembly_Scripts}) -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(Assembly PROPERTIES COMPILE_FLAGS "-fext-numeric-literals") -endif() -target_link_libraries(Assembly ${Assembly_LIBS} ${log_LIB}) - - -fc_target_copy_resource_flat(Assembly - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/Mod/Assembly - ${Assembly_Scripts}) - -SET_BIN_DIR(Assembly Assembly /Mod/Assembly) -SET_PYTHON_PREFIX_SUFFIX(Assembly) - -INSTALL(TARGETS Assembly DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(MSVC) + add_definitions(-DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) +else(MSVC) + add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) +endif(MSVC) + +add_definitions(-DBOOST_${Boost_VERSION}) + +include_directories( + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_BINARY_DIR}/src + ${CMAKE_SOURCE_DIR}/src/Mod/Assembly/App + ${CMAKE_CURRENT_BINARY_DIR} + ${Boost_INCLUDE_DIRS} + ${OCC_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} + #${ODE_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} + +) + +link_directories(${OCC_LIBRARY_DIR}) + +set(Assembly_LIBS + #${ODE_LIBRARIES} + ${OCC_LIBRARIES} + ${Boost_LIBRARIES} + ${Boost_LOG_LIBRARY_RELEASE} + Part + FreeCADApp +) + +generate_from_xml(ItemPy) +generate_from_xml(ProductRefPy) +#generate_from_xml(PartRefPy) +generate_from_xml(ConstraintPy) +generate_from_xml(ConstraintGroupPy) + +SET(Features_SRCS + Item.cpp + Item.h + #PartRef.cpp + #PartRef.h + Product.cpp + Product.h + ProductRef.cpp + ProductRef.h + Constraint.cpp + Constraint.h + ConstraintGroup.cpp + ConstraintGroup.h +) +SOURCE_GROUP("Features" FILES ${Features_SRCS}) + +SET(Module_SRCS + AppAssembly.cpp + AppAssemblyPy.cpp + PreCompiled.cpp + PreCompiled.h +) +SOURCE_GROUP("Module" FILES ${Module_SRCS}) + +#externalization is not possible for msvc as a stupid bug prevents the function definition resolving +if(MSVC) + set(Solver_SRC ) +else(MSVC) + set(Solver_SRC Solver/solver_3d_ext1.cpp + Solver/solver_3d_ext2.cpp + Solver/solver_3d_ext3.cpp + ) + + if(FREECAD_ASSEMBLY_DEBUG_FACILITIES) + set(Solver_SRC ${Solver_SRC} + Solver/solver_state_ext1.cpp + Solver/solver_state_ext2.cpp + ) + endif(FREECAD_ASSEMBLY_DEBUG_FACILITIES) +endif(MSVC) + +SOURCE_GROUP("Solver" FILES ${Solver_SRC}) + +SET(Python_SRCS + ItemPy.xml + ItemPyImp.cpp + ProductRefPy.xml + ProductRefPyImp.cpp + #PartRefPy.xml + #PartRefPyImp.cpp + ConstraintPy.xml + ConstraintPyImp.cpp + ConstraintGroupPy.xml + ConstraintGroupPyImp.cpp +) +SOURCE_GROUP("Python" FILES ${Python_SRCS}) + +SET(Assembly_SRCS + ${Features_SRCS} + ${Python_SRCS} + ${Module_SRCS} + ${Solver_SRC} +) + +SET(Assembly_Scripts + ../Init.py + ../AssemblyLib.py +) + +add_library(Assembly SHARED ${Assembly_SRCS} ${Assembly_Scripts}) +if(CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(Assembly PROPERTIES COMPILE_FLAGS "-fext-numeric-literals") +endif() +target_link_libraries(Assembly ${Assembly_LIBS} ${log_LIB}) + + +fc_target_copy_resource_flat(Assembly + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/Mod/Assembly + ${Assembly_Scripts}) + +SET_BIN_DIR(Assembly Assembly /Mod/Assembly) +SET_PYTHON_PREFIX_SUFFIX(Assembly) + +INSTALL(TARGETS Assembly DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/Mod/Assembly/App/PreCompiled.h b/src/Mod/Assembly/App/PreCompiled.h index 8dfc4eb52a..b7c175278d 100644 --- a/src/Mod/Assembly/App/PreCompiled.h +++ b/src/Mod/Assembly/App/PreCompiled.h @@ -50,9 +50,6 @@ #include #include -#include - - // OpenCasCade ===================================================================================== // Base #include diff --git a/src/Mod/Assembly/Gui/AppAssemblyGui.cpp b/src/Mod/Assembly/Gui/AppAssemblyGui.cpp index 1ff44d567d..df43e5c0cc 100644 --- a/src/Mod/Assembly/Gui/AppAssemblyGui.cpp +++ b/src/Mod/Assembly/Gui/AppAssemblyGui.cpp @@ -20,11 +20,7 @@ * * ***************************************************************************/ - #include "PreCompiled.h" -#ifndef _PreComp_ -# include -#endif #include #include diff --git a/src/Mod/Assembly/Gui/AppAssemblyGuiPy.cpp b/src/Mod/Assembly/Gui/AppAssemblyGuiPy.cpp index 84fbd5d714..02aa1aeb6c 100644 --- a/src/Mod/Assembly/Gui/AppAssemblyGuiPy.cpp +++ b/src/Mod/Assembly/Gui/AppAssemblyGuiPy.cpp @@ -20,11 +20,7 @@ * * ***************************************************************************/ - #include "PreCompiled.h" -#ifndef _PreComp_ -# include -#endif #include #include diff --git a/src/Mod/Assembly/Gui/CMakeLists.txt b/src/Mod/Assembly/Gui/CMakeLists.txt index 4f6ee3f94b..fa80be50bf 100644 --- a/src/Mod/Assembly/Gui/CMakeLists.txt +++ b/src/Mod/Assembly/Gui/CMakeLists.txt @@ -1,122 +1,121 @@ -if(MSVC) - add_definitions(-DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) -else(MSVC) - add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) -endif(MSVC) - -include_directories( - ${CMAKE_SOURCE_DIR}/src - ${CMAKE_SOURCE_DIR}/src/Mod/Assembly/App - ${CMAKE_CURRENT_BINARY_DIR} - ${Boost_INCLUDE_DIRS} - ${COIN_INCLUDE_DIR} - ${ZLIB_INCLUDE_DIR} - ${OCC_INCLUDE_DIR} - ${QT_INCLUDE_DIR} - ${PYTHON_INCLUDE_DIRS} - ${COIN3D_INCLUDE_DIRS} - ${XercesC_INCLUDE_DIRS} - ${EIGEN3_INCLUDE_DIR} -) - -link_directories(${OCC_LIBRARY_DIR}) - -set(AssemblyGui_LIBS - #${ODE_LIBRARIES} - Assembly - PartGui - FreeCADGui -) - -set(AssemblyGui_MOC_HDRS - #TaskAssemblyConstraints.h - #TaskDlgAssemblyConstraints.h -) -fc_wrap_cpp(AssemblyGui_MOC_SRCS ${AssemblyGui_MOC_HDRS}) -SOURCE_GROUP("Moc" FILES ${AssemblyGui_MOC_SRCS}) - -if (BUILD_QT5) - qt5_add_resources(AssemblyGui_SRCS Resources/Assembly.qrc) -else() - qt4_add_resources(AssemblyGui_SRCS Resources/Assembly.qrc) -endif() - -set(AssemblyGui_UIC_SRCS - #TaskAssemblyConstraints.ui -) -if (BUILD_QT5) - qt5_wrap_ui(AssemblyGui_UIC_HDRS ${AssemblyGui_UIC_SRCS}) -else() - qt4_wrap_ui(AssemblyGui_UIC_HDRS ${AssemblyGui_UIC_SRCS}) -endif() - -SET(AssemblyGuiViewProvider_SRCS - ViewProvider.cpp - ViewProvider.h - #ViewProviderPartRef.cpp - #ViewProviderPartRef.h - ViewProviderProduct.cpp - ViewProviderProduct.h - ViewProviderProductRef.cpp - ViewProviderProductRef.h - ViewProviderConstraint.cpp - ViewProviderConstraint.h - ViewProviderConstraintGroup.cpp - ViewProviderConstraintGroup.h - #TaskDlgAssemblyConstraints.cpp - #TaskDlgAssemblyConstraints.h - #TaskAssemblyConstraints.h - #TaskAssemblyConstraints.cpp -) -SOURCE_GROUP("ViewProvider" FILES ${AssemblyGuiViewProvider_SRCS}) - -SET(AssemblyGuiModule_SRCS - AppAssemblyGui.cpp - AppAssemblyGuiPy.cpp - Command.cpp - CommandConstraints.cpp - Resources/Assembly.qrc - #qrc_Assembly.cxx - PreCompiled.cpp - PreCompiled.h - Workbench.cpp - Workbench.h -) -SOURCE_GROUP("Module" FILES ${AssemblyGuiModule_SRCS}) - - -SET(AssemblyGui_SRCS - ${AssemblyGui_SRCS} - ${AssemblyGuiViewProvider_SRCS} - ${AssemblyGuiModule_SRCS} - ${AssemblyGui_UIC_HDRS} -) - -SET(AssemblyGui_Scripts - ../InitGui.py -) - -add_library(AssemblyGui SHARED ${AssemblyGui_SRCS} ${AssemblyGui_Scripts}) -if(CMAKE_COMPILER_IS_GNUCXX) - set_target_properties(AssemblyGui PROPERTIES COMPILE_FLAGS "-fext-numeric-literals") -endif() -target_link_libraries(AssemblyGui ${AssemblyGui_LIBS}) - - -fc_target_copy_resource_flat(AssemblyGui - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_BINARY_DIR}/Mod/Assembly - ${AssemblyGui_Scripts}) - -SET_BIN_DIR(AssemblyGui AssemblyGui /Mod/Assembly) -SET_PYTHON_PREFIX_SUFFIX(AssemblyGui) - -INSTALL(TARGETS AssemblyGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) - -SET(AssemblyGuiIcon_SVG - Resources/icons/AssemblyWorkbench.svg -) - -fc_copy_sources(AssemblyGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Assembly" ${AssemblyGuiIcon_SVG}) - -INSTALL(FILES ${AssemblyGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Assembly/Resources/icons") +if(MSVC) + add_definitions(-DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) +else(MSVC) + add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) +endif(MSVC) + +include_directories( + ${CMAKE_SOURCE_DIR}/src + ${CMAKE_SOURCE_DIR}/src/Mod/Assembly/App + ${CMAKE_CURRENT_BINARY_DIR} + ${Boost_INCLUDE_DIRS} + ${COIN_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIR} + ${OCC_INCLUDE_DIR} + ${QT_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} + ${COIN3D_INCLUDE_DIRS} + ${EIGEN3_INCLUDE_DIR} +) + +link_directories(${OCC_LIBRARY_DIR}) + +set(AssemblyGui_LIBS + #${ODE_LIBRARIES} + Assembly + PartGui + FreeCADGui +) + +set(AssemblyGui_MOC_HDRS + #TaskAssemblyConstraints.h + #TaskDlgAssemblyConstraints.h +) +fc_wrap_cpp(AssemblyGui_MOC_SRCS ${AssemblyGui_MOC_HDRS}) +SOURCE_GROUP("Moc" FILES ${AssemblyGui_MOC_SRCS}) + +if (BUILD_QT5) + qt5_add_resources(AssemblyGui_SRCS Resources/Assembly.qrc) +else() + qt4_add_resources(AssemblyGui_SRCS Resources/Assembly.qrc) +endif() + +set(AssemblyGui_UIC_SRCS + #TaskAssemblyConstraints.ui +) +if (BUILD_QT5) + qt5_wrap_ui(AssemblyGui_UIC_HDRS ${AssemblyGui_UIC_SRCS}) +else() + qt4_wrap_ui(AssemblyGui_UIC_HDRS ${AssemblyGui_UIC_SRCS}) +endif() + +SET(AssemblyGuiViewProvider_SRCS + ViewProvider.cpp + ViewProvider.h + #ViewProviderPartRef.cpp + #ViewProviderPartRef.h + ViewProviderProduct.cpp + ViewProviderProduct.h + ViewProviderProductRef.cpp + ViewProviderProductRef.h + ViewProviderConstraint.cpp + ViewProviderConstraint.h + ViewProviderConstraintGroup.cpp + ViewProviderConstraintGroup.h + #TaskDlgAssemblyConstraints.cpp + #TaskDlgAssemblyConstraints.h + #TaskAssemblyConstraints.h + #TaskAssemblyConstraints.cpp +) +SOURCE_GROUP("ViewProvider" FILES ${AssemblyGuiViewProvider_SRCS}) + +SET(AssemblyGuiModule_SRCS + AppAssemblyGui.cpp + AppAssemblyGuiPy.cpp + Command.cpp + CommandConstraints.cpp + Resources/Assembly.qrc + #qrc_Assembly.cxx + PreCompiled.cpp + PreCompiled.h + Workbench.cpp + Workbench.h +) +SOURCE_GROUP("Module" FILES ${AssemblyGuiModule_SRCS}) + + +SET(AssemblyGui_SRCS + ${AssemblyGui_SRCS} + ${AssemblyGuiViewProvider_SRCS} + ${AssemblyGuiModule_SRCS} + ${AssemblyGui_UIC_HDRS} +) + +SET(AssemblyGui_Scripts + ../InitGui.py +) + +add_library(AssemblyGui SHARED ${AssemblyGui_SRCS} ${AssemblyGui_Scripts}) +if(CMAKE_COMPILER_IS_GNUCXX) + set_target_properties(AssemblyGui PROPERTIES COMPILE_FLAGS "-fext-numeric-literals") +endif() +target_link_libraries(AssemblyGui ${AssemblyGui_LIBS}) + + +fc_target_copy_resource_flat(AssemblyGui + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_BINARY_DIR}/Mod/Assembly + ${AssemblyGui_Scripts}) + +SET_BIN_DIR(AssemblyGui AssemblyGui /Mod/Assembly) +SET_PYTHON_PREFIX_SUFFIX(AssemblyGui) + +INSTALL(TARGETS AssemblyGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) + +SET(AssemblyGuiIcon_SVG + Resources/icons/AssemblyWorkbench.svg +) + +fc_copy_sources(AssemblyGui "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/Assembly" ${AssemblyGuiIcon_SVG}) + +INSTALL(FILES ${AssemblyGuiIcon_SVG} DESTINATION "${CMAKE_INSTALL_DATADIR}/Mod/Assembly/Resources/icons") diff --git a/src/Mod/Assembly/Gui/PreCompiled.h b/src/Mod/Assembly/Gui/PreCompiled.h index ba8da58953..1c75151bc5 100644 --- a/src/Mod/Assembly/Gui/PreCompiled.h +++ b/src/Mod/Assembly/Gui/PreCompiled.h @@ -44,9 +44,6 @@ #ifdef _PreComp_ -// Python -#include - // standard #include #include