From c9d28b542fab87970137e2c8deb035235a857aba Mon Sep 17 00:00:00 2001 From: Uwe Date: Sun, 20 Mar 2022 19:03:52 +0100 Subject: [PATCH] [Import] remove unused includes and Xerces --- src/Mod/Import/App/AppImportPy.cpp | 2 - src/Mod/Import/App/CMakeLists.txt | 183 +++++++++++++------------- src/Mod/Import/App/PreCompiled.h | 6 - src/Mod/Import/Gui/AppImportGui.cpp | 6 +- src/Mod/Import/Gui/AppImportGuiPy.cpp | 109 +++++++-------- src/Mod/Import/Gui/CMakeLists.txt | 91 +++++++------ src/Mod/Import/Gui/Command.cpp | 7 +- src/Mod/Import/Gui/PreCompiled.h | 7 - src/Mod/Import/Gui/Workbench.cpp | 6 +- 9 files changed, 185 insertions(+), 232 deletions(-) diff --git a/src/Mod/Import/App/AppImportPy.cpp b/src/Mod/Import/App/AppImportPy.cpp index a3d6068ced..9e819445dd 100644 --- a/src/Mod/Import/App/AppImportPy.cpp +++ b/src/Mod/Import/App/AppImportPy.cpp @@ -20,13 +20,11 @@ * * ***************************************************************************/ - #include "PreCompiled.h" #if defined(__MINGW32__) # define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ -# include # include #if defined(__clang__) # pragma clang diagnostic push diff --git a/src/Mod/Import/App/CMakeLists.txt b/src/Mod/Import/App/CMakeLists.txt index 685e11eb68..8a28e52026 100644 --- a/src/Mod/Import/App/CMakeLists.txt +++ b/src/Mod/Import/App/CMakeLists.txt @@ -1,92 +1,91 @@ -if(MSVC) - add_definitions(-DFCAppImport -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) -else(MSVC) - add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) -endif(MSVC) - - -include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${Boost_INCLUDE_DIRS} - ${OCC_INCLUDE_DIR} - ${ZLIB_INCLUDE_DIR} - ${PYTHON_INCLUDE_DIRS} - ${XercesC_INCLUDE_DIRS} -) - -link_directories(${OCC_LIBRARY_DIR}) - -set(Import_LIBS - Part - #Assembly - ${OCC_OCAF_LIBRARIES} - ${OCC_OCAF_DEBUG_LIBRARIES} -) - -SET(Import_SRCS - AppImport.cpp - AppImportPy.cpp - ExportOCAF.cpp - ExportOCAF.h - ImportOCAF.cpp - ImportOCAF.h - ImportOCAF2.cpp - ImportOCAF2.h - #ImportOCAFAssembly.cpp - #ImportOCAFAssembly.h - StepShapePy.xml - StepShape.h - StepShape.cpp - StepShapePyImp.cpp - PreCompiled.cpp - PreCompiled.h - ImpExpDxf.cpp - ImpExpDxf.h - dxf.cpp - dxf.h -) - -SET(SCL_Resources - SCL/__init__.py - SCL/AggregationDataTypes.py - SCL/BaseType.py - SCL/Builtin.py - SCL/ConstructedDataTypes.py - SCL/essa_par.py - SCL/Model.py - SCL/Part21.py - SCL/Rules.py - SCL/SCLBase.py - SCL/SimpleDataTypes.py - SCL/TypeChecker.py - SCL/Utils.py - SCL/SimpleReader.py - SCL/Aufspannung.stp - SCL/gasket1.p21 - SCL/Product1.stp - automotive_design.py # AP214e3 - ifc2x3.py # IFC - ifc4.py # IFC 4 - PlmXmlParser.py -) -SOURCE_GROUP("SCL" FILES ${SCL_Resources}) - -generate_from_xml(StepShapePy) - -add_library(Import SHARED ${Import_SRCS}) -target_link_libraries(Import ${Import_LIBS}) - -ADD_CUSTOM_TARGET(ImportPy ALL - SOURCES ${SCL_Resources} -) - -fc_target_copy_resource(ImportPy - ${CMAKE_SOURCE_DIR}/src/Mod/Import/App - ${CMAKE_BINARY_DIR}/Mod/Import - ${SCL_Resources}) - -SET_BIN_DIR(Import Import /Mod/Import) -SET_PYTHON_PREFIX_SUFFIX(Import) - -INSTALL(TARGETS Import DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(MSVC) + add_definitions(-DFCAppImport -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) +else(MSVC) + add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) +endif(MSVC) + + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${Boost_INCLUDE_DIRS} + ${OCC_INCLUDE_DIR} + ${ZLIB_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} +) + +link_directories(${OCC_LIBRARY_DIR}) + +set(Import_LIBS + Part + #Assembly + ${OCC_OCAF_LIBRARIES} + ${OCC_OCAF_DEBUG_LIBRARIES} +) + +SET(Import_SRCS + AppImport.cpp + AppImportPy.cpp + ExportOCAF.cpp + ExportOCAF.h + ImportOCAF.cpp + ImportOCAF.h + ImportOCAF2.cpp + ImportOCAF2.h + #ImportOCAFAssembly.cpp + #ImportOCAFAssembly.h + StepShapePy.xml + StepShape.h + StepShape.cpp + StepShapePyImp.cpp + PreCompiled.cpp + PreCompiled.h + ImpExpDxf.cpp + ImpExpDxf.h + dxf.cpp + dxf.h +) + +SET(SCL_Resources + SCL/__init__.py + SCL/AggregationDataTypes.py + SCL/BaseType.py + SCL/Builtin.py + SCL/ConstructedDataTypes.py + SCL/essa_par.py + SCL/Model.py + SCL/Part21.py + SCL/Rules.py + SCL/SCLBase.py + SCL/SimpleDataTypes.py + SCL/TypeChecker.py + SCL/Utils.py + SCL/SimpleReader.py + SCL/Aufspannung.stp + SCL/gasket1.p21 + SCL/Product1.stp + automotive_design.py # AP214e3 + ifc2x3.py # IFC + ifc4.py # IFC 4 + PlmXmlParser.py +) +SOURCE_GROUP("SCL" FILES ${SCL_Resources}) + +generate_from_xml(StepShapePy) + +add_library(Import SHARED ${Import_SRCS}) +target_link_libraries(Import ${Import_LIBS}) + +ADD_CUSTOM_TARGET(ImportPy ALL + SOURCES ${SCL_Resources} +) + +fc_target_copy_resource(ImportPy + ${CMAKE_SOURCE_DIR}/src/Mod/Import/App + ${CMAKE_BINARY_DIR}/Mod/Import + ${SCL_Resources}) + +SET_BIN_DIR(Import Import /Mod/Import) +SET_PYTHON_PREFIX_SUFFIX(Import) + +INSTALL(TARGETS Import DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/Mod/Import/App/PreCompiled.h b/src/Mod/Import/App/PreCompiled.h index ff6550f23e..9e2cf88023 100644 --- a/src/Mod/Import/App/PreCompiled.h +++ b/src/Mod/Import/App/PreCompiled.h @@ -49,9 +49,6 @@ #ifdef _PreComp_ -// Python -#include - // standard #include #include @@ -63,9 +60,6 @@ #include #include -// Xerces -#include - // OpenCasCade ===================================================================================== // Base #include "OpenCascadeAll.h" diff --git a/src/Mod/Import/Gui/AppImportGui.cpp b/src/Mod/Import/Gui/AppImportGui.cpp index 0f135c754e..4e730c068e 100644 --- a/src/Mod/Import/Gui/AppImportGui.cpp +++ b/src/Mod/Import/Gui/AppImportGui.cpp @@ -21,20 +21,16 @@ * * ***************************************************************************/ - #include "PreCompiled.h" -#ifndef _PreComp_ -#endif -#include #include #include #include - #include #include "Workbench.h" + // use a different name to CreateCommand() void CreateImportCommands(void); diff --git a/src/Mod/Import/Gui/AppImportGuiPy.cpp b/src/Mod/Import/Gui/AppImportGuiPy.cpp index 36dcee2578..4c94137551 100644 --- a/src/Mod/Import/Gui/AppImportGuiPy.cpp +++ b/src/Mod/Import/Gui/AppImportGuiPy.cpp @@ -20,39 +20,32 @@ * * ***************************************************************************/ - #include "PreCompiled.h" #if defined(__MINGW32__) # define WNT // avoid conflict with GUID #endif #ifndef _PreComp_ -# include -# include # include +# include + +# include +# include +# include +# include # include +# include +# include +# include +# include +# include +# include + #if defined(__clang__) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wextra-semi" #endif -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include + +# include # include # include # include @@ -60,80 +53,70 @@ # include # include # include -# include -# include -# include -# include -# include -# include -# include -# include # include +# include +# include +# include # include -#if OCC_VERSION_HEX >= 0x070500 -# include -# include -#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + #if OCC_VERSION_HEX >= 0x060500 # include # else # include # endif +#if OCC_VERSION_HEX >= 0x070500 +# include +# include +#endif + #if defined(__clang__) # pragma clang diagnostic pop #endif #endif -#include -#include - -#include -#include -#include #include #include -#include +#include +#include #include +#include #include +#include +#include +#include +#include #include -#include -#include +#include #include #include -#include -#include +#include +#include #include #include #include -#include #include -#include +#include #include #include #include #include #include #include -#include #include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include FC_LOG_LEVEL_INIT("Import", true, true) diff --git a/src/Mod/Import/Gui/CMakeLists.txt b/src/Mod/Import/Gui/CMakeLists.txt index 101c7fae57..438ff59c48 100644 --- a/src/Mod/Import/Gui/CMakeLists.txt +++ b/src/Mod/Import/Gui/CMakeLists.txt @@ -1,46 +1,45 @@ -if(MSVC) - add_definitions(-DFCAppPart -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) -else(MSVC) - add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) -endif(MSVC) - - -include_directories( - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_BINARY_DIR} - ${Boost_INCLUDE_DIRS} - ${OCC_INCLUDE_DIR} - ${COIN3D_INCLUDE_DIRS} - ${ZLIB_INCLUDE_DIR} - ${PYTHON_INCLUDE_DIRS} - ${XercesC_INCLUDE_DIRS} -) - -link_directories(${OCC_LIBRARY_DIR}) - -set(ImportGui_LIBS - FreeCADGui - PartGui - Import - ${OCC_OCAF_LIBRARIES} - ${OCC_OCAF_DEBUG_LIBRARIES} -) - -SET(ImportGui_SRCS - AppImportGui.cpp - AppImportGuiPy.cpp - Command.cpp - PreCompiled.cpp - PreCompiled.h - Workbench.cpp - Workbench.h -) - -add_library(ImportGui SHARED ${ImportGui_SRCS}) -target_link_libraries(ImportGui ${ImportGui_LIBS}) - - -SET_BIN_DIR(ImportGui ImportGui /Mod/Import) -SET_PYTHON_PREFIX_SUFFIX(ImportGui) - -INSTALL(TARGETS ImportGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if(MSVC) + add_definitions(-DFCAppPart -DHAVE_ACOSH -DHAVE_ASINH -DHAVE_ATANH) +else(MSVC) + add_definitions(-DHAVE_LIMITS_H -DHAVE_CONFIG_H) +endif(MSVC) + + +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${Boost_INCLUDE_DIRS} + ${OCC_INCLUDE_DIR} + ${COIN3D_INCLUDE_DIRS} + ${ZLIB_INCLUDE_DIR} + ${PYTHON_INCLUDE_DIRS} +) + +link_directories(${OCC_LIBRARY_DIR}) + +set(ImportGui_LIBS + FreeCADGui + PartGui + Import + ${OCC_OCAF_LIBRARIES} + ${OCC_OCAF_DEBUG_LIBRARIES} +) + +SET(ImportGui_SRCS + AppImportGui.cpp + AppImportGuiPy.cpp + Command.cpp + PreCompiled.cpp + PreCompiled.h + Workbench.cpp + Workbench.h +) + +add_library(ImportGui SHARED ${ImportGui_SRCS}) +target_link_libraries(ImportGui ${ImportGui_LIBS}) + + +SET_BIN_DIR(ImportGui ImportGui /Mod/Import) +SET_PYTHON_PREFIX_SUFFIX(ImportGui) + +INSTALL(TARGETS ImportGui DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/src/Mod/Import/Gui/Command.cpp b/src/Mod/Import/Gui/Command.cpp index 35ba34aec3..291a165aae 100644 --- a/src/Mod/Import/Gui/Command.cpp +++ b/src/Mod/Import/Gui/Command.cpp @@ -20,18 +20,13 @@ * * ***************************************************************************/ - #include "PreCompiled.h" -#ifndef _PreComp_ -#endif -#include #include -#include #include -#include #include #include +#include //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/src/Mod/Import/Gui/PreCompiled.h b/src/Mod/Import/Gui/PreCompiled.h index cc6fc83806..7255b638e8 100644 --- a/src/Mod/Import/Gui/PreCompiled.h +++ b/src/Mod/Import/Gui/PreCompiled.h @@ -50,9 +50,6 @@ #ifdef _PreComp_ -// Python -#include - // standard #include #include @@ -64,14 +61,10 @@ #include #include -#include #ifndef FC_OS_WIN32 # include #endif -// Xerces -#include - // OpenCasCade Base #include "OpenCascadeAll.h" diff --git a/src/Mod/Import/Gui/Workbench.cpp b/src/Mod/Import/Gui/Workbench.cpp index 35b22c215b..7369f3c2a0 100644 --- a/src/Mod/Import/Gui/Workbench.cpp +++ b/src/Mod/Import/Gui/Workbench.cpp @@ -20,15 +20,11 @@ * * ***************************************************************************/ - #include "PreCompiled.h" -#ifndef _PreComp_ -# include -#endif +#include #include "Workbench.h" -#include using namespace ImportGui;