Refactor precompiled headers and improve Windows compatibility.
Extend TKernel, TKMath and TKBRep pch with more usage headers.
Implement PCH for TKDEIGES, TKDESTEP, TKMesh, and TKXSBase.
install (FILES ${OCCT_HEADER_FILES_COMPLETE} DESTINATION "${INSTALL_DIR}/${THE_OCCT_INSTALL_DIR_PREFIX}")
endfunction()
-function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER)
+function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER THE_IS_PRIVATE)
if (NOT BUILD_USE_PCH)
return()
endif()
- target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
+ if (${THE_IS_PRIVATE})
+ target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
+ else()
+ target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
+ endif()
endfunction()
macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
-ADD_PRECOMPILED_HEADER(TKBRep "${CMAKE_CURRENT_SOURCE_DIR}/TKBRep_pch.hxx")
+ADD_PRECOMPILED_HEADER(TKBRep "${CMAKE_CURRENT_SOURCE_DIR}/TKBRep_pch.hxx" FALSE)
#ifndef TKBRep_HXX
#define TKBRep_HXX
-// Windows-specific headers (for MSVC)
-#ifdef _WIN32
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-#include <windows.h> // For Windows API functions like WideCharToMultiByte
-#include <tchar.h> // For Unicode/MBCS mappings
-#ifdef GetObject
-#undef GetObject
-#endif
-#endif
-
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Shell.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Wire.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Builder.hxx>
#include <TopoDS_CompSolid.hxx>
#include <TopoDS_Compound.hxx>
-#include <TopoDS_Builder.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Shell.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Wire.hxx>
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
-#include <BRepTools.hxx>
-
#endif // TKBRep_HXX
\ No newline at end of file
project(TKDEIGES)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
+
+# Add the precompiled header
+ADD_PRECOMPILED_HEADER(TKDEIGES "${CMAKE_CURRENT_SOURCE_DIR}/TKDEIGES_pch.hxx" TRUE)
--- /dev/null
+#ifndef TKDEIGES_PCH_H
+#define TKDEIGES_PCH_H
+
+#include <IGESData_HArray1OfIGESEntity.hxx>
+#include <IGESData_IGESEntity.hxx>
+#include <IGESData_IGESReaderData.hxx>
+#include <IGESData_ParamReader.hxx>
+
+#endif // TKDEIGES_PCH_H
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
+# Add the precompiled header
+ADD_PRECOMPILED_HEADER(TKDESTEP "${CMAKE_CURRENT_SOURCE_DIR}/TKDESTEP_pch.hxx" TRUE)
+
FLEX_AND_BISON_TARGET_APPLY ("StepFile" src)
--- /dev/null
+#ifndef TKDESTEP_PCH_H
+#define TKDESTEP_PCH_H
+
+#include <StepData_StepReaderData.hxx>
+#include <StepData_StepWriter.hxx>
+#include <StepGeom_GeometricRepresentationItem.hxx>
+#include <StepKinematics_KinematicPair.hxx>
+#include <StepRepr_Representation.hxx>
+#include <StepRepr_RepresentationItem.hxx>
+
+#endif // TKDESTEP_PCH_H
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
# Add the precompiled header
-ADD_PRECOMPILED_HEADER(TKMath "${CMAKE_CURRENT_SOURCE_DIR}/TKMath_pch.hxx")
+ADD_PRECOMPILED_HEADER(TKMath "${CMAKE_CURRENT_SOURCE_DIR}/TKMath_pch.hxx" FALSE)
#ifndef TKMATH_PCH_H
#define TKMATH_PCH_H
-// Standard library headers
-#include <type_traits>
-
-// Windows-specific headers (for MSVC)
-#ifdef _WIN32
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-#include <windows.h> // For Windows API functions like WideCharToMultiByte
-#include <tchar.h> // For Unicode/MBCS mappings
-#ifdef GetObject
-#undef GetObject
-#endif
-#endif
-
-#include <gp_Pnt.hxx>
-#include <gp_Vec.hxx>
-#include <gp_Dir.hxx>
#include <gp_Ax1.hxx>
#include <gp_Ax2.hxx>
-#include <gp_Trsf.hxx>
+#include <gp_Ax3.hxx>
+#include <gp_Circ.hxx>
+#include <gp_Dir.hxx>
+#include <gp_Elips.hxx>
+#include <gp_Hypr.hxx>
+#include <gp_Lin.hxx>
+#include <gp_Lin2d.hxx>
+#include <gp_Pnt.hxx>
#include <gp_Quaternion.hxx>
+#include <gp_Trsf.hxx>
+#include <gp_Vec.hxx>
+
+#include <PLib.hxx>
+
+#include <BSplCLib.hxx>
#include <TopLoc_Location.hxx>
project(TKMesh)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
+
+# Add the precompiled header
+ADD_PRECOMPILED_HEADER(TKMesh "${CMAKE_CURRENT_SOURCE_DIR}/TKMesh_pch.hxx" TRUE)
--- /dev/null
+#ifndef TKMESH_PCH_H
+#define TKMESH_PCH_H
+
+#include <IMeshData_Types.hxx>
+
+#endif // TKMESH_PCH_H
project(TKV3d)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
+
+# Add the precompiled header
+ADD_PRECOMPILED_HEADER(TKV3d "${CMAKE_CURRENT_SOURCE_DIR}/TKV3d_pch.hxx" TRUE)
--- /dev/null
+#ifndef TKTKV3d_PCH_H
+#define TKTKV3d_PCH_H
+
+#include <AIS_InteractiveObject.hxx>
+#include <PrsMgr_PresentableObject.hxx>
+#include <SelectMgr_EntityOwner.hxx>
+#include <SelectMgr_SelectableObject.hxx>
+
+#endif // TKTKV3d_PCH_H
project(TKXSBase)
OCCT_INCLUDE_CMAKE_FILE (adm/cmake/occt_toolkit)
+
+# Add the precompiled header
+ADD_PRECOMPILED_HEADER(TKXSBase "${CMAKE_CURRENT_SOURCE_DIR}/TKXSBase_pch.hxx" TRUE)
--- /dev/null
+#ifndef TKXSBASE_PCH_H
+#define TKXSBASE_PCH_H
+
+#include <Interface_Check.hxx>
+#include <Interface_CheckIterator.hxx>
+#include <Interface_EntityIterator.hxx>
+#include <Interface_FileReaderData.hxx>
+#include <Interface_Graph.hxx>
+
+#endif // TKXSBASE_PCH_H
endif()
# Add the precompiled header
-ADD_PRECOMPILED_HEADER(TKernel "${CMAKE_CURRENT_SOURCE_DIR}/TKernel_pch.hxx")
+ADD_PRECOMPILED_HEADER(TKernel "${CMAKE_CURRENT_SOURCE_DIR}/TKernel_pch.hxx" FALSE)
#define TKERNEL_PCH_H
// Standard library headers
+#include <atomic>
+#include <iostream>
+#include <limits>
+#include <ostream>
+#include <random>
+#include <sstream>
+#include <string>
#include <type_traits>
// Windows-specific headers (for MSVC)
#ifdef _WIN32
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-#include <windows.h> // For Windows API functions like WideCharToMultiByte
-#include <tchar.h> // For Unicode/MBCS mappings
-#ifdef GetObject
-#undef GetObject
-#endif
+ #ifndef NOMINMAX
+ #define NOMINMAX
+ #endif
+ #include <tchar.h> // For Unicode/MBCS mappings
+ #include <windows.h> // For Windows API functions like WideCharToMultiByte
+ #ifdef GetObject
+ #undef GetObject
+ #endif
#endif
// TKernel headers
#include <Standard.hxx>
-#include <Standard_Type.hxx>
#include <Standard_DefineHandle.hxx>
-#include <Standard_Macro.hxx>
-#include <Standard_Transient.hxx>
+#include <Standard_GUID.hxx>
#include <Standard_Handle.hxx>
+#include <Standard_Macro.hxx>
#include <Standard_Stream.hxx>
-#include <Standard_GUID.hxx>
+#include <Standard_Transient.hxx>
+#include <Standard_Type.hxx>
#include <Precision.hxx>
#include <Quantity_Color.hxx>
#include <Quantity_ColorRGBA.hxx>
-#include <Quantity_HArray1OfColor.hxx>
#include <Quantity_TypeOfColor.hxx>
#include <TCollection_AsciiString.hxx>
#include <TCollection_HAsciiString.hxx>
#include <TCollection_HExtendedString.hxx>
-#include <NCollection_BaseAllocator.hxx>
#include <NCollection_Array1.hxx>
#include <NCollection_Array2.hxx>
-#include <NCollection_Map.hxx>
+#include <NCollection_BaseAllocator.hxx>
+#include <NCollection_Buffer.hxx>
#include <NCollection_DataMap.hxx>
-#include <NCollection_List.hxx>
-#include <NCollection_Sequence.hxx>
+#include <NCollection_DefineHArray1.hxx>
#include <NCollection_IndexedDataMap.hxx>
#include <NCollection_IndexedMap.hxx>
+#include <NCollection_List.hxx>
+#include <NCollection_Map.hxx>
+#include <NCollection_Sequence.hxx>
+
+#include <Message_ProgressIndicator.hxx>
+#include <Message_ProgressRange.hxx>
+#include <Message_ProgressScope.hxx>
+
+#include <OSD_Parallel.hxx>
+#include <OSD_Path.hxx>
#endif // TKERNEL_PCH_H
\ No newline at end of file