diff --git a/adm/cmake/occt_macros.cmake b/adm/cmake/occt_macros.cmake index 800c2b42f9..3d78b6f2d5 100644 --- a/adm/cmake/occt_macros.cmake +++ b/adm/cmake/occt_macros.cmake @@ -456,11 +456,15 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC 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 "$<$:${PRECOMPILED_HEADER}>") + if (${THE_IS_PRIVATE}) + target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$:${PRECOMPILED_HEADER}>") + else() + target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$:${PRECOMPILED_HEADER}>") + endif() endfunction() macro (OCCT_COPY_FILE_OR_DIR BEING_COPIED_OBJECT DESTINATION_PATH) diff --git a/src/TKBRep/CMakeLists.txt b/src/TKBRep/CMakeLists.txt index 66a3f6731c..f6622c2e74 100644 --- a/src/TKBRep/CMakeLists.txt +++ b/src/TKBRep/CMakeLists.txt @@ -3,4 +3,4 @@ project(TKBRep) 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) diff --git a/src/TKBRep/TKBRep_pch.hxx b/src/TKBRep/TKBRep_pch.hxx index 9912afd95b..341ed29b7a 100644 --- a/src/TKBRep/TKBRep_pch.hxx +++ b/src/TKBRep/TKBRep_pch.hxx @@ -1,33 +1,19 @@ #ifndef TKBRep_HXX #define TKBRep_HXX -// Windows-specific headers (for MSVC) -#ifdef _WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif -#include // For Windows API functions like WideCharToMultiByte -#include // For Unicode/MBCS mappings -#ifdef GetObject -#undef GetObject -#endif -#endif - -#include -#include -#include -#include -#include -#include -#include +#include #include #include -#include +#include +#include #include +#include +#include +#include +#include +#include #include #include -#include - #endif // TKBRep_HXX \ No newline at end of file diff --git a/src/TKDEIGES/CMakeLists.txt b/src/TKDEIGES/CMakeLists.txt index a7e09e50e4..2ba9c60382 100644 --- a/src/TKDEIGES/CMakeLists.txt +++ b/src/TKDEIGES/CMakeLists.txt @@ -1,3 +1,6 @@ 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) diff --git a/src/TKDEIGES/TKDEIGES_pch.hxx b/src/TKDEIGES/TKDEIGES_pch.hxx new file mode 100644 index 0000000000..f525f09bb6 --- /dev/null +++ b/src/TKDEIGES/TKDEIGES_pch.hxx @@ -0,0 +1,9 @@ +#ifndef TKDEIGES_PCH_H +#define TKDEIGES_PCH_H + +#include +#include +#include +#include + +#endif // TKDEIGES_PCH_H diff --git a/src/TKDESTEP/CMakeLists.txt b/src/TKDESTEP/CMakeLists.txt index 7ae7872796..5a6b02e23e 100644 --- a/src/TKDESTEP/CMakeLists.txt +++ b/src/TKDESTEP/CMakeLists.txt @@ -2,4 +2,7 @@ project(TKDESTEP) 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) diff --git a/src/TKDESTEP/TKDESTEP_pch.hxx b/src/TKDESTEP/TKDESTEP_pch.hxx new file mode 100644 index 0000000000..49d7770cb1 --- /dev/null +++ b/src/TKDESTEP/TKDESTEP_pch.hxx @@ -0,0 +1,11 @@ +#ifndef TKDESTEP_PCH_H +#define TKDESTEP_PCH_H + +#include +#include +#include +#include +#include +#include + +#endif // TKDESTEP_PCH_H diff --git a/src/TKMath/CMakeLists.txt b/src/TKMath/CMakeLists.txt index 7c49b4496f..57b6486378 100644 --- a/src/TKMath/CMakeLists.txt +++ b/src/TKMath/CMakeLists.txt @@ -3,4 +3,4 @@ project(TKMath) 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) diff --git a/src/TKMath/TKMath_pch.hxx b/src/TKMath/TKMath_pch.hxx index 92b7a78643..c9ae8cd7d6 100644 --- a/src/TKMath/TKMath_pch.hxx +++ b/src/TKMath/TKMath_pch.hxx @@ -1,28 +1,23 @@ #ifndef TKMATH_PCH_H #define TKMATH_PCH_H -// Standard library headers -#include - -// Windows-specific headers (for MSVC) -#ifdef _WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif -#include // For Windows API functions like WideCharToMultiByte -#include // For Unicode/MBCS mappings -#ifdef GetObject -#undef GetObject -#endif -#endif - -#include -#include -#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include + +#include + +#include #include diff --git a/src/TKMesh/CMakeLists.txt b/src/TKMesh/CMakeLists.txt index c63df5aa58..d4ca239ba3 100644 --- a/src/TKMesh/CMakeLists.txt +++ b/src/TKMesh/CMakeLists.txt @@ -1,3 +1,6 @@ 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) diff --git a/src/TKMesh/TKMesh_pch.hxx b/src/TKMesh/TKMesh_pch.hxx new file mode 100644 index 0000000000..ffd99b74a8 --- /dev/null +++ b/src/TKMesh/TKMesh_pch.hxx @@ -0,0 +1,6 @@ +#ifndef TKMESH_PCH_H +#define TKMESH_PCH_H + +#include + +#endif // TKMESH_PCH_H diff --git a/src/TKV3d/CMakeLists.txt b/src/TKV3d/CMakeLists.txt index 1fa271d26d..9745c5b65e 100644 --- a/src/TKV3d/CMakeLists.txt +++ b/src/TKV3d/CMakeLists.txt @@ -1,3 +1,6 @@ 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) diff --git a/src/TKV3d/TKV3d_pch.hxx b/src/TKV3d/TKV3d_pch.hxx new file mode 100644 index 0000000000..93ff979583 --- /dev/null +++ b/src/TKV3d/TKV3d_pch.hxx @@ -0,0 +1,9 @@ +#ifndef TKTKV3d_PCH_H +#define TKTKV3d_PCH_H + +#include +#include +#include +#include + +#endif // TKTKV3d_PCH_H diff --git a/src/TKXSBase/CMakeLists.txt b/src/TKXSBase/CMakeLists.txt index 4b8ad112ac..e8c7631d00 100644 --- a/src/TKXSBase/CMakeLists.txt +++ b/src/TKXSBase/CMakeLists.txt @@ -1,3 +1,6 @@ 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) diff --git a/src/TKXSBase/TKXSBase_pch.hxx b/src/TKXSBase/TKXSBase_pch.hxx new file mode 100644 index 0000000000..ef4295daf8 --- /dev/null +++ b/src/TKXSBase/TKXSBase_pch.hxx @@ -0,0 +1,10 @@ +#ifndef TKXSBASE_PCH_H +#define TKXSBASE_PCH_H + +#include +#include +#include +#include +#include + +#endif // TKXSBASE_PCH_H diff --git a/src/TKernel/CMakeLists.txt b/src/TKernel/CMakeLists.txt index 4e4dfe0592..ff4e72705b 100644 --- a/src/TKernel/CMakeLists.txt +++ b/src/TKernel/CMakeLists.txt @@ -14,4 +14,4 @@ else () 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) diff --git a/src/TKernel/TKernel_pch.hxx b/src/TKernel/TKernel_pch.hxx index aec52cad76..7f72876c12 100644 --- a/src/TKernel/TKernel_pch.hxx +++ b/src/TKernel/TKernel_pch.hxx @@ -2,35 +2,41 @@ #define TKERNEL_PCH_H // Standard library headers +#include +#include +#include +#include +#include +#include +#include #include // Windows-specific headers (for MSVC) #ifdef _WIN32 -#ifndef NOMINMAX -#define NOMINMAX -#endif -#include // For Windows API functions like WideCharToMultiByte -#include // For Unicode/MBCS mappings -#ifdef GetObject -#undef GetObject -#endif + #ifndef NOMINMAX + #define NOMINMAX + #endif + #include // For Unicode/MBCS mappings + #include // For Windows API functions like WideCharToMultiByte + #ifdef GetObject + #undef GetObject + #endif #endif // TKernel headers #include -#include #include -#include -#include +#include #include +#include #include -#include +#include +#include #include #include #include -#include #include #include @@ -38,14 +44,23 @@ #include #include -#include #include #include -#include +#include +#include #include -#include -#include +#include #include #include +#include +#include +#include + +#include +#include +#include + +#include +#include #endif // TKERNEL_PCH_H \ No newline at end of file