diff --git a/src/3d/CMakeLists.txt b/src/3d/CMakeLists.txt index 42904ad8a7e7..4d9939d00825 100644 --- a/src/3d/CMakeLists.txt +++ b/src/3d/CMakeLists.txt @@ -239,6 +239,8 @@ set (QGIS_3D_RCCS shaders.qrc ../../resources/3d/textures/textures.qrc) add_library(qgis_3d SHARED ${QGIS_3D_SRCS} ${QGIS_3D_HDRS} ${QGIS_3D_RCCS} ${QGIS_3D_PRIVATE_HDRS}) +target_precompile_headers(qgis_3d PRIVATE $<$:${CMAKE_SOURCE_DIR}/src/core/qgis.h>) + # require c++17 target_compile_features(qgis_3d PRIVATE cxx_std_17) diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt index 4fa7297706bc..18d503154375 100644 --- a/src/analysis/CMakeLists.txt +++ b/src/analysis/CMakeLists.txt @@ -520,6 +520,8 @@ endif() add_library(qgis_analysis ${LIBRARY_TYPE} ${QGIS_ANALYSIS_SRCS} ${QGIS_ANALYSIS_HDRS}) +target_precompile_headers(qgis_analysis PRIVATE $<$:${CMAKE_SOURCE_DIR}/src/core/qgis.h>) + # require c++17 target_compile_features(qgis_analysis PRIVATE cxx_std_17) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 1fd7c2278cf1..f4d622a36ef1 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -611,6 +611,8 @@ target_link_libraries(qgis_app target_compile_definitions(qgis_app PRIVATE "-DQT_NO_FOREACH") +target_precompile_headers(qgis_app PRIVATE $<$:${CMAKE_SOURCE_DIR}/src/core/qgis.h>) + if (WITH_BINDINGS) add_definitions(-DWITH_BINDINGS) target_link_libraries(qgis_app qgispython) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 91cc4dadd3a1..055d540798ee 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -2337,6 +2337,8 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_library(qgis_core ${LIBRARY_TYPE} ${QGIS_CORE_SRCS} ${QGIS_CORE_HDRS} ${QGIS_CORE_PRIVATE_HDRS} ${IMAGE_RCCS}) +target_precompile_headers(qgis_core PRIVATE $<$:qgis.h>) + # Add meshoptimizer if(WITH_INTERNAL_MESHOPTIMIZER) target_sources(qgis_core PRIVATE diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 9e9aa88fa51e..08db60f49961 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1678,6 +1678,8 @@ add_library(qgis_gui ${LIBRARY_TYPE} # require c++17 target_compile_features(qgis_gui PRIVATE cxx_std_17) +target_precompile_headers(qgis_gui PRIVATE $<$:${CMAKE_SOURCE_DIR}/src/core/qgis.h>) + target_include_directories(qgis_gui SYSTEM PUBLIC ${QWT_INCLUDE_DIR} ${QSCINTILLA_INCLUDE_DIR}