diff --git a/cmake/jkqtplotter_cmake_options.cmake b/cmake/jkqtplotter_cmake_options.cmake index d6748d7288..0d587a06cb 100644 --- a/cmake/jkqtplotter_cmake_options.cmake +++ b/cmake/jkqtplotter_cmake_options.cmake @@ -16,6 +16,9 @@ endif() if(NOT DEFINED JKQtPlotter_BUILD_FORCE_NO_PRINTER_SUPPORT) option(JKQtPlotter_BUILD_FORCE_NO_PRINTER_SUPPORT "Build the library with printer support switched off, even if it is available" OFF) endif() +if(NOT DEFINED JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + option(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS "Build the library using precompiled headers to improve compile speed" ON) +endif() if(NOT DEFINED CMAKE_INSTALL_PREFIX) option(CMAKE_INSTALL_PREFIX "Install directory" ${CMAKE_CURRENT_SOURCE_DIR}/install) endif() diff --git a/doc/dox/buildinstructions.dox b/doc/dox/buildinstructions.dox index 3b330edb2c..af996692ec 100644 --- a/doc/dox/buildinstructions.dox +++ b/doc/dox/buildinstructions.dox @@ -53,6 +53,7 @@ The CMake build system offers several configuration variables that you may set/c - \c JKQtPlotter_BUILD_INCLUDE_XITS_FONTS : Include XITS fonts as resources in library (default: \c ON ) - \c JKQtPlotter_BUILD_FORCE_NO_PRINTER_SUPPORT : switches off print-support (when set to \c ON ), even if the current platform supports it (default: \c OFF ) - \c JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE : If set, the build-type is appended to the library name (default: \c ON ) + - \c JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS : If set, the build uses precompiled headers to speed up (a bit) (default: \c ON ) - \c JKQtPlotter_BUILD_EXAMPLES : Build examples (default: \c ON ) - \c CMAKE_INSTALL_PREFIX : Install directory for the library . diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7f407e28e7..2cb1552544 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -5,6 +5,11 @@ message( STATUS "............................................................... message( STATUS ".. BUILDING EXAMPLES" ) message( STATUS "............................................................................." ) +# needs to be first for Precompiled Headers to work +add_subdirectory(simpletest) + + + add_subdirectory(jkqtfastplotter_test) add_subdirectory(jkqtmathtext_simpletest) @@ -49,7 +54,6 @@ add_subdirectory(rgbimageplot) add_subdirectory(rgbimageplot_cimg) add_subdirectory(rgbimageplot_opencv) add_subdirectory(rgbimageplot_qt) -add_subdirectory(simpletest) add_subdirectory(speed) add_subdirectory(stackedbars) add_subdirectory(stepplots) diff --git a/examples/advplotstyling/CMakeLists.txt b/examples/advplotstyling/CMakeLists.txt index 5bc6306d7d..cf7d6888cc 100644 --- a/examples/advplotstyling/CMakeLists.txt +++ b/examples/advplotstyling/CMakeLists.txt @@ -16,14 +16,15 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/examples/barchart/CMakeLists.txt b/examples/barchart/CMakeLists.txt index 611db1df23..66aadcf290 100644 --- a/examples/barchart/CMakeLists.txt +++ b/examples/barchart/CMakeLists.txt @@ -16,14 +16,14 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/boxplot/CMakeLists.txt b/examples/boxplot/CMakeLists.txt index abf93d2145..a254705cf8 100644 --- a/examples/boxplot/CMakeLists.txt +++ b/examples/boxplot/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/contourplot/CMakeLists.txt b/examples/contourplot/CMakeLists.txt index 3d4a1a0b0b..29bb2ed728 100644 --- a/examples/contourplot/CMakeLists.txt +++ b/examples/contourplot/CMakeLists.txt @@ -16,14 +16,14 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/datastore/CMakeLists.txt b/examples/datastore/CMakeLists.txt index 88fe77a642..07e73ba39a 100644 --- a/examples/datastore/CMakeLists.txt +++ b/examples/datastore/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/datastore_groupedstat/CMakeLists.txt b/examples/datastore_groupedstat/CMakeLists.txt index d9cb46332e..e43e530808 100644 --- a/examples/datastore_groupedstat/CMakeLists.txt +++ b/examples/datastore_groupedstat/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/datastore_iterators/CMakeLists.txt b/examples/datastore_iterators/CMakeLists.txt index 4084e7d29b..80648ad1e0 100644 --- a/examples/datastore_iterators/CMakeLists.txt +++ b/examples/datastore_iterators/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/datastore_regression/CMakeLists.txt b/examples/datastore_regression/CMakeLists.txt index 05c783ab38..1075e3d220 100644 --- a/examples/datastore_regression/CMakeLists.txt +++ b/examples/datastore_regression/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/datastore_statistics/CMakeLists.txt b/examples/datastore_statistics/CMakeLists.txt index 59e7e1a069..97cf47fe4d 100644 --- a/examples/datastore_statistics/CMakeLists.txt +++ b/examples/datastore_statistics/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/datastore_statistics_2d/CMakeLists.txt b/examples/datastore_statistics_2d/CMakeLists.txt index b4c8db7b80..67e5871460 100644 --- a/examples/datastore_statistics_2d/CMakeLists.txt +++ b/examples/datastore_statistics_2d/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/dateaxes/CMakeLists.txt b/examples/dateaxes/CMakeLists.txt index f30dd4b6cc..518f4f1b34 100644 --- a/examples/dateaxes/CMakeLists.txt +++ b/examples/dateaxes/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/distributionplot/CMakeLists.txt b/examples/distributionplot/CMakeLists.txt index f6a03f43a3..cc8f465a7d 100644 --- a/examples/distributionplot/CMakeLists.txt +++ b/examples/distributionplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/errorbarstyles/CMakeLists.txt b/examples/errorbarstyles/CMakeLists.txt index 5174d65341..e4607c265d 100644 --- a/examples/errorbarstyles/CMakeLists.txt +++ b/examples/errorbarstyles/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/evalcurve/CMakeLists.txt b/examples/evalcurve/CMakeLists.txt index 0f41734934..fffd438bb5 100644 --- a/examples/evalcurve/CMakeLists.txt +++ b/examples/evalcurve/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/filledgraphs/CMakeLists.txt b/examples/filledgraphs/CMakeLists.txt index 79480b8dca..e84b51a173 100644 --- a/examples/filledgraphs/CMakeLists.txt +++ b/examples/filledgraphs/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/functionplot/CMakeLists.txt b/examples/functionplot/CMakeLists.txt index bb994f2f4f..1920ee4a60 100644 --- a/examples/functionplot/CMakeLists.txt +++ b/examples/functionplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/geo_arrows/CMakeLists.txt b/examples/geo_arrows/CMakeLists.txt index ef62e0184f..5299fc1b81 100644 --- a/examples/geo_arrows/CMakeLists.txt +++ b/examples/geo_arrows/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/geo_simple/CMakeLists.txt b/examples/geo_simple/CMakeLists.txt index fd83cfc3d9..2559a2972a 100644 --- a/examples/geo_simple/CMakeLists.txt +++ b/examples/geo_simple/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/geometric/CMakeLists.txt b/examples/geometric/CMakeLists.txt index 10e29ae9e0..7679b60b5f 100644 --- a/examples/geometric/CMakeLists.txt +++ b/examples/geometric/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/imageplot/CMakeLists.txt b/examples/imageplot/CMakeLists.txt index 6176d2a615..eac98d207c 100644 --- a/examples/imageplot/CMakeLists.txt +++ b/examples/imageplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/imageplot_cimg/CMakeLists.txt b/examples/imageplot_cimg/CMakeLists.txt index a3f940881f..3fb8e90c6d 100644 --- a/examples/imageplot_cimg/CMakeLists.txt +++ b/examples/imageplot_cimg/CMakeLists.txt @@ -22,6 +22,11 @@ if(CImg_FOUND) endif() target_link_libraries(${EXENAME} CImg::CImg) + # precomiled headers to speed up compilation + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) + endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/examples/imageplot_modifier/CMakeLists.txt b/examples/imageplot_modifier/CMakeLists.txt index 8f26711701..ea10120441 100644 --- a/examples/imageplot_modifier/CMakeLists.txt +++ b/examples/imageplot_modifier/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/imageplot_nodatastore/CMakeLists.txt b/examples/imageplot_nodatastore/CMakeLists.txt index dbbc41d5d4..6a86c8463d 100644 --- a/examples/imageplot_nodatastore/CMakeLists.txt +++ b/examples/imageplot_nodatastore/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/imageplot_opencv/CMakeLists.txt b/examples/imageplot_opencv/CMakeLists.txt index 88fb029fa4..1f8cd81919 100644 --- a/examples/imageplot_opencv/CMakeLists.txt +++ b/examples/imageplot_opencv/CMakeLists.txt @@ -23,6 +23,11 @@ if(OpenCV_FOUND) include_directories(${EXENAME} ${OpenCV_INCLUDE_DIRS} ) target_link_libraries(${EXENAME} ${OpenCV_LIBS} ) + # precomiled headers to speed up compilation + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) + endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/examples/imageplot_userpal/CMakeLists.txt b/examples/imageplot_userpal/CMakeLists.txt index 5e64c6d746..bd2c8ffea7 100644 --- a/examples/imageplot_userpal/CMakeLists.txt +++ b/examples/imageplot_userpal/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/impulsesplot/CMakeLists.txt b/examples/impulsesplot/CMakeLists.txt index 75d4c2bf6e..0c449a52b5 100644 --- a/examples/impulsesplot/CMakeLists.txt +++ b/examples/impulsesplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/jkqtplot_test/CMakeLists.txt b/examples/jkqtplot_test/CMakeLists.txt index ef894b5301..eedc02a215 100644 --- a/examples/jkqtplot_test/CMakeLists.txt +++ b/examples/jkqtplot_test/CMakeLists.txt @@ -26,14 +26,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/logaxes/CMakeLists.txt b/examples/logaxes/CMakeLists.txt index b57668674c..023a4b8ec6 100644 --- a/examples/logaxes/CMakeLists.txt +++ b/examples/logaxes/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/mandelbrot/CMakeLists.txt b/examples/mandelbrot/CMakeLists.txt index bfbbaf597c..aea208e6b6 100644 --- a/examples/mandelbrot/CMakeLists.txt +++ b/examples/mandelbrot/CMakeLists.txt @@ -17,15 +17,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() target_link_libraries(${EXENAME} Threads::Threads) +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/examples/multiplot/CMakeLists.txt b/examples/multiplot/CMakeLists.txt index 13b716bb47..3ce2f55b6b 100644 --- a/examples/multiplot/CMakeLists.txt +++ b/examples/multiplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/parametriccurve/CMakeLists.txt b/examples/parametriccurve/CMakeLists.txt index a18cfef35e..e9b7538d8c 100644 --- a/examples/parametriccurve/CMakeLists.txt +++ b/examples/parametriccurve/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/paramscatterplot/CMakeLists.txt b/examples/paramscatterplot/CMakeLists.txt index 5ab15310d2..d05950c2c3 100644 --- a/examples/paramscatterplot/CMakeLists.txt +++ b/examples/paramscatterplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/paramscatterplot_image/CMakeLists.txt b/examples/paramscatterplot_image/CMakeLists.txt index 3f4b1c5927..83c5f25a57 100644 --- a/examples/paramscatterplot_image/CMakeLists.txt +++ b/examples/paramscatterplot_image/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/parsedfunctionplot/CMakeLists.txt b/examples/parsedfunctionplot/CMakeLists.txt index d5a8e5878d..e17e1ef0ed 100644 --- a/examples/parsedfunctionplot/CMakeLists.txt +++ b/examples/parsedfunctionplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/rgbimageplot/CMakeLists.txt b/examples/rgbimageplot/CMakeLists.txt index 7841cb7a1e..8b666a0374 100644 --- a/examples/rgbimageplot/CMakeLists.txt +++ b/examples/rgbimageplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/rgbimageplot_cimg/CMakeLists.txt b/examples/rgbimageplot_cimg/CMakeLists.txt index 993aeceda6..b27e2d4efc 100644 --- a/examples/rgbimageplot_cimg/CMakeLists.txt +++ b/examples/rgbimageplot_cimg/CMakeLists.txt @@ -22,6 +22,11 @@ if(CImg_FOUND) endif() target_link_libraries(${EXENAME} CImg::CImg) + # precomiled headers to speed up compilation + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) + endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/examples/rgbimageplot_opencv/CMakeLists.txt b/examples/rgbimageplot_opencv/CMakeLists.txt index 95af5a2671..0e30838e11 100644 --- a/examples/rgbimageplot_opencv/CMakeLists.txt +++ b/examples/rgbimageplot_opencv/CMakeLists.txt @@ -23,6 +23,11 @@ if (OpenCV_FOUND) include_directories(${EXENAME} ${OpenCV_INCLUDE_DIRS} ) target_link_libraries(${EXENAME} ${OpenCV_LIBS} ) + # precomiled headers to speed up compilation + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) + endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/examples/rgbimageplot_qt/CMakeLists.txt b/examples/rgbimageplot_qt/CMakeLists.txt index 0b6fa1e99b..325ccf9826 100644 --- a/examples/rgbimageplot_qt/CMakeLists.txt +++ b/examples/rgbimageplot_qt/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/simpletest/CMakeLists.txt b/examples/simpletest/CMakeLists.txt index 3d45296aea..8d3c435b4c 100644 --- a/examples/simpletest/CMakeLists.txt +++ b/examples/simpletest/CMakeLists.txt @@ -16,14 +16,14 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) # Installation diff --git a/examples/speed/CMakeLists.txt b/examples/speed/CMakeLists.txt index 92727b07e8..de90c2f608 100644 --- a/examples/speed/CMakeLists.txt +++ b/examples/speed/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/stackedbars/CMakeLists.txt b/examples/stackedbars/CMakeLists.txt index e390d4058d..b4188224e2 100644 --- a/examples/stackedbars/CMakeLists.txt +++ b/examples/stackedbars/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/stepplots/CMakeLists.txt b/examples/stepplots/CMakeLists.txt index 59a480ed2f..24e4d545fc 100644 --- a/examples/stepplots/CMakeLists.txt +++ b/examples/stepplots/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/styledboxplot/CMakeLists.txt b/examples/styledboxplot/CMakeLists.txt index dad298ddd9..7f12e3b207 100644 --- a/examples/styledboxplot/CMakeLists.txt +++ b/examples/styledboxplot/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/styling/CMakeLists.txt b/examples/styling/CMakeLists.txt index 8dfeacda38..57f165c67c 100644 --- a/examples/styling/CMakeLists.txt +++ b/examples/styling/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/symbols_and_errors/CMakeLists.txt b/examples/symbols_and_errors/CMakeLists.txt index 17b3d22af1..ce426d0701 100644 --- a/examples/symbols_and_errors/CMakeLists.txt +++ b/examples/symbols_and_errors/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/symbols_and_styles/CMakeLists.txt b/examples/symbols_and_styles/CMakeLists.txt index c60d49e1a8..fa814529de 100644 --- a/examples/symbols_and_styles/CMakeLists.txt +++ b/examples/symbols_and_styles/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/ui/CMakeLists.txt b/examples/ui/CMakeLists.txt index 275db5ca88..facc8db5ce 100644 --- a/examples/ui/CMakeLists.txt +++ b/examples/ui/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/examples/user_interaction/CMakeLists.txt b/examples/user_interaction/CMakeLists.txt index f553987ba5..dba74ae5b5 100644 --- a/examples/user_interaction/CMakeLists.txt +++ b/examples/user_interaction/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/violinplot/CMakeLists.txt b/examples/violinplot/CMakeLists.txt index 37809281c2..b6f9569d15 100644 --- a/examples/violinplot/CMakeLists.txt +++ b/examples/violinplot/CMakeLists.txt @@ -16,14 +16,16 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) # Installation diff --git a/examples/wiggleplots/CMakeLists.txt b/examples/wiggleplots/CMakeLists.txt index 7f782c195a..e804beb311 100644 --- a/examples/wiggleplots/CMakeLists.txt +++ b/examples/wiggleplots/CMakeLists.txt @@ -16,14 +16,17 @@ add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) target_include_directories(${EXENAME} PRIVATE ../../lib) if(JKQtPlotter_BUILD_STATIC_LIBS) target_link_libraries(${EXENAME} JKQTPlotterLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - # precomiled headers to speed up compilation - target_precompile_headers(${EXENAME} PRIVATE ../../lib/jkqtplotter/private/jkqtplotter_precomp.h) + endif() +# precomiled headers to speed up compilation +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${EXENAME} REUSE_FROM jkqtptest_simpletest) +endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + # Installation diff --git a/lib/jkqtcommon/CMakeLists.txt b/lib/jkqtcommon/CMakeLists.txt index a83e2c690d..fc4fe22427 100644 --- a/lib/jkqtcommon/CMakeLists.txt +++ b/lib/jkqtcommon/CMakeLists.txt @@ -120,8 +120,10 @@ function(JKQtCommon_setDefaultLibOptions TARGETNAME) $ ) # precomiled headers to speed up compilation - target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h) - target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h) + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h) + target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtcommon_precomp.h) + endif(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) endfunction() diff --git a/lib/jkqtmathtext/CMakeLists.txt b/lib/jkqtmathtext/CMakeLists.txt index 4afdfcb962..223017605e 100644 --- a/lib/jkqtmathtext/CMakeLists.txt +++ b/lib/jkqtmathtext/CMakeLists.txt @@ -118,8 +118,10 @@ function(JKQtMathText_setDefaultLibOptions TARGETNAME) endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) # precomiled headers to speed up compilation - target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h) - target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h) + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h) + target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtmathtext_precomp.h) + endif(JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) endfunction() if(JKQtPlotter_BUILD_SHARED_LIBS) diff --git a/lib/jkqtplotter/CMakeLists.txt b/lib/jkqtplotter/CMakeLists.txt index 559004d044..d033146ca4 100644 --- a/lib/jkqtplotter/CMakeLists.txt +++ b/lib/jkqtplotter/CMakeLists.txt @@ -222,8 +222,10 @@ function(JKQtPlottter_setDefaultLibOptions TARGETNAME) ) # precomiled headers to speed up compilation - target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h) - target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h) + if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + target_precompile_headers(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h) + target_sources(${TARGETNAME} PRIVATE ${CMAKE_CURRENT_LIST_DIR}/private/jkqtplotter_precomp.h) + endif (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) endfunction()