diff --git a/cmake/jkqtplotter_cmake_options.cmake b/cmake/jkqtplotter_cmake_options.cmake index 0d587a06cb..8f69be2775 100644 --- a/cmake/jkqtplotter_cmake_options.cmake +++ b/cmake/jkqtplotter_cmake_options.cmake @@ -47,3 +47,4 @@ if(JKQtPlotter_BUILD_DECORATE_LIBNAMES_WITH_BUILDTYPE) else() set(JKQtPlotter_LIBNAME_ADDITION ) endif() + diff --git a/cmake/jkqtplotter_common_compilersettings.cmake b/cmake/jkqtplotter_common_compilersettings.cmake index 627cbff808..1b54a838df 100644 --- a/cmake/jkqtplotter_common_compilersettings.cmake +++ b/cmake/jkqtplotter_common_compilersettings.cmake @@ -4,3 +4,9 @@ cmake_minimum_required(VERSION 3.1) if(NOT APPLE) set(CMAKE_INSTALL_RPATH $ORIGIN) endif() + + +math(EXPR JKQtPlotter_BIT_DEPTH ${CMAKE_SIZEOF_VOID_P}*8) + +find_package( CImg QUIET ) +find_package( OpenCV QUIET ) diff --git a/cmake/jkqtplotter_common_qtsettings.cmake b/cmake/jkqtplotter_common_qtsettings.cmake index 9349370f11..707fa69cf4 100644 --- a/cmake/jkqtplotter_common_qtsettings.cmake +++ b/cmake/jkqtplotter_common_qtsettings.cmake @@ -33,3 +33,12 @@ else() endif() endif() +if(${QT_VERSION_MAJOR} VERSION_LESS "6") + set(JKQtPlotter_QT_CXX_STANDARD 11) + set(JKQtPlotter_QT_CXX_STANDARD_REQUIRED TRUE) + set(JKQtPlotter_QT_CXX_COMPILE_FEATURE cxx_std_11) +else() + set(JKQtPlotter_QT_CXX_STANDARD 17) + set(JKQtPlotter_QT_CXX_STANDARD_REQUIRED TRUE) + set(JKQtPlotter_QT_CXX_COMPILE_FEATURE cxx_std_17) +endif() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 2cb1552544..eb6fd3b84e 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,22 +1,45 @@ cmake_minimum_required(VERSION 3.16) + message( STATUS ) message( STATUS "............................................................................." ) message( STATUS ".. BUILDING EXAMPLES" ) message( STATUS "............................................................................." ) +if(CImg_FOUND) + message( STATUS ".. - CIMG available: BUILDING CImg-binding examples" ) +else() + message( STATUS ".. - CIMG NOT available: SKIPPING CImg-binding examples" ) +endif() +if(OpenCV_FOUND) + message( STATUS ".. - OpenCV available: BUILDING OpenCV-binding examples" ) +else() + message( STATUS ".. - OpenCV NOT available: SKIPPING OpenCV-binding examples" ) +endif() +if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) + message( STATUS ".. - Precompiled Header: ON" ) +else() + message( STATUS ".. - Precompiled Header: OFF") +endif() -# needs to be first for Precompiled Headers to work -add_subdirectory(simpletest) +message( STATUS "............................................................................." ) +# examples for JKQtFastPlotter +message( STATUS ".. BUILDING EXAMPLES FOR JKQTFASTPLOTTER:" ) add_subdirectory(jkqtfastplotter_test) +# examples specific to JKQtMathText +message( STATUS ".. BUILDING EXAMPLES FOR JKQTMATHTEXT:" ) add_subdirectory(jkqtmathtext_simpletest) add_subdirectory(jkqtmathtext_test) -add_subdirectory(jkqtplot_test) +# examples for JKQtPlotter +message( STATUS ".. BUILDING EXAMPLES FOR JKQTPLOTTER:" ) +# needs to be first for Precompiled Headers to work +add_subdirectory(simpletest) +add_subdirectory(jkqtplot_test) add_subdirectory(advplotstyling) add_subdirectory(barchart) add_subdirectory(boxplot) diff --git a/examples/imageplot_cimg/CMakeLists.txt b/examples/imageplot_cimg/CMakeLists.txt index 3fb8e90c6d..e7d854ca45 100644 --- a/examples/imageplot_cimg/CMakeLists.txt +++ b/examples/imageplot_cimg/CMakeLists.txt @@ -1,36 +1,40 @@ cmake_minimum_required(VERSION 3.16) -find_package( CImg ) +if(NOT DEFINED CImg_FOUND) + find_package( CImg ) +endif() +set(EXAMPLE_NAME imageplot_cimg) if(CImg_FOUND) - set(EXAMPLE_NAME imageplot_cimg) - set(EXENAME jkqtptest_${EXAMPLE_NAME}) + set(EXENAME jkqtptest_${EXAMPLE_NAME}) - message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) + message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) - # Set up source files - set(SOURCES ${EXAMPLE_NAME}.cpp) - set(HEADERS ) - set(RESOURCES ) - set(UIS ) + # Set up source files + set(SOURCES ${EXAMPLE_NAME}.cpp) + set(HEADERS ) + set(RESOURCES ) + set(UIS ) - add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) - target_include_directories(${EXENAME} PRIVATE ../../lib) - if(JKQtPlotter_BUILD_STATIC_LIBS) - target_link_libraries(${EXENAME} JKQTPlotterLib) - elseif(JKQtPlotter_BUILD_SHARED_LIBS) - target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - endif() - target_link_libraries(${EXENAME} CImg::CImg) + add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) + target_include_directories(${EXENAME} PRIVATE ../../lib) + if(JKQtPlotter_BUILD_STATIC_LIBS) + target_link_libraries(${EXENAME} JKQTPlotterLib) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) + target_link_libraries(${EXENAME} JKQTPlotterSharedLib) + 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) + # 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}) + # Installation + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - #Installation of Qt DLLs on Windows - jkqtplotter_deployqt(${EXENAME}) + #Installation of Qt DLLs on Windows + jkqtplotter_deployqt(${EXENAME}) +else() + message( STATUS ".. SKIPPING Example ${EXAMPLE_NAME}, CImg not found" ) endif(CImg_FOUND) diff --git a/examples/imageplot_opencv/CMakeLists.txt b/examples/imageplot_opencv/CMakeLists.txt index 1f8cd81919..a9e06fa894 100644 --- a/examples/imageplot_opencv/CMakeLists.txt +++ b/examples/imageplot_opencv/CMakeLists.txt @@ -1,8 +1,10 @@ cmake_minimum_required(VERSION 3.16) -find_package( OpenCV ) +if(NOT DEFINED OpenCV_FOUND) + find_package( OpenCV QUITE ) +endif() +set(EXAMPLE_NAME imageplot_opencv) if(OpenCV_FOUND) - set(EXAMPLE_NAME imageplot_opencv) set(EXENAME jkqtptest_${EXAMPLE_NAME}) message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) @@ -37,5 +39,6 @@ if(OpenCV_FOUND) #Installation of OpenCV DLLs on Windows jkqtplotter_deployopencv(${EXENAME}) - +else() + message( STATUS ".. SKIPPING Example ${EXAMPLE_NAME}, OpenCV not found" ) endif(OpenCV_FOUND) diff --git a/examples/rgbimageplot_cimg/CMakeLists.txt b/examples/rgbimageplot_cimg/CMakeLists.txt index b27e2d4efc..5628cf643b 100644 --- a/examples/rgbimageplot_cimg/CMakeLists.txt +++ b/examples/rgbimageplot_cimg/CMakeLists.txt @@ -1,38 +1,42 @@ cmake_minimum_required(VERSION 3.16) -find_package( CImg ) +if(NOT DEFINED CImg_FOUND) + find_package( CImg ) +endif() +set(EXAMPLE_NAME rgbimageplot_cimg) if(CImg_FOUND) - set(EXAMPLE_NAME rgbimageplot_cimg) - set(EXENAME jkqtptest_${EXAMPLE_NAME}) + set(EXENAME jkqtptest_${EXAMPLE_NAME}) - message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) + message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) - # Set up source files - set(SOURCES ${EXAMPLE_NAME}.cpp) - set(HEADERS ) - set(RESOURCES ) - set(UIS ) + # Set up source files + set(SOURCES ${EXAMPLE_NAME}.cpp) + set(HEADERS ) + set(RESOURCES ) + set(UIS ) - add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) - target_include_directories(${EXENAME} PRIVATE ../../lib) - if(JKQtPlotter_BUILD_STATIC_LIBS) - target_link_libraries(${EXENAME} JKQTPlotterLib) - elseif(JKQtPlotter_BUILD_SHARED_LIBS) - target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - endif() - target_link_libraries(${EXENAME} CImg::CImg) + add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) + target_include_directories(${EXENAME} PRIVATE ../../lib) + if(JKQtPlotter_BUILD_STATIC_LIBS) + target_link_libraries(${EXENAME} JKQTPlotterLib) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) + target_link_libraries(${EXENAME} JKQTPlotterSharedLib) + 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) + # 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}) - - #Installation of Qt DLLs on Windows - jkqtplotter_deployqt(${EXENAME}) - add_custom_command(TARGET ${EXENAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/rgbimageplot_cimg_example.bmp" $ - ) + # Installation + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + + #Installation of Qt DLLs on Windows + jkqtplotter_deployqt(${EXENAME}) + add_custom_command(TARGET ${EXENAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/rgbimageplot_cimg_example.bmp" $ + ) +else() + message( STATUS ".. SKIPPING Example ${EXAMPLE_NAME}, CImg not found" ) endif(CImg_FOUND) diff --git a/examples/rgbimageplot_opencv/CMakeLists.txt b/examples/rgbimageplot_opencv/CMakeLists.txt index 0e30838e11..0fa4f0b3db 100644 --- a/examples/rgbimageplot_opencv/CMakeLists.txt +++ b/examples/rgbimageplot_opencv/CMakeLists.txt @@ -1,42 +1,46 @@ cmake_minimum_required(VERSION 3.16) -find_package( OpenCV ) +if(NOT DEFINED OpenCV_FOUND) + find_package( OpenCV QUITE ) +endif() +set(EXAMPLE_NAME rgbimageplot_opencv) if (OpenCV_FOUND) - set(EXAMPLE_NAME rgbimageplot_opencv) - set(EXENAME jkqtptest_${EXAMPLE_NAME}) + set(EXENAME jkqtptest_${EXAMPLE_NAME}) - message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) + message( STATUS ".. Building Example ${EXAMPLE_NAME}" ) - # Set up source files - set(SOURCES ${EXAMPLE_NAME}.cpp) - set(HEADERS ) - set(RESOURCES ) - set(UIS ) + # Set up source files + set(SOURCES ${EXAMPLE_NAME}.cpp) + set(HEADERS ) + set(RESOURCES ) + set(UIS ) - add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) - target_include_directories(${EXENAME} PRIVATE ../../lib) - if(JKQtPlotter_BUILD_STATIC_LIBS) - target_link_libraries(${EXENAME} JKQTPlotterLib) - elseif(JKQtPlotter_BUILD_SHARED_LIBS) - target_link_libraries(${EXENAME} JKQTPlotterSharedLib) - endif() - include_directories(${EXENAME} ${OpenCV_INCLUDE_DIRS} ) - target_link_libraries(${EXENAME} ${OpenCV_LIBS} ) + add_executable(${EXENAME} WIN32 ${SOURCES} ${HEADERS} ${RESOURCES} ${UIS}) + target_include_directories(${EXENAME} PRIVATE ../../lib) + if(JKQtPlotter_BUILD_STATIC_LIBS) + target_link_libraries(${EXENAME} JKQTPlotterLib) + elseif(JKQtPlotter_BUILD_SHARED_LIBS) + target_link_libraries(${EXENAME} JKQTPlotterSharedLib) + endif() + 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) + # 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}) - #Installation of Qt DLLs on Windows - jkqtplotter_deployqt(${EXENAME}) - #Installation of OpenCV DLLs on Windows - jkqtplotter_deployopencv(${EXENAME}) - add_custom_command(TARGET ${EXENAME} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/rgbimageplot_opencv_example.bmp" $ - ) + # Installation + install(TARGETS ${EXENAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + #Installation of Qt DLLs on Windows + jkqtplotter_deployqt(${EXENAME}) + #Installation of OpenCV DLLs on Windows + jkqtplotter_deployopencv(${EXENAME}) + add_custom_command(TARGET ${EXENAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/rgbimageplot_opencv_example.bmp" $ + ) +else() + message( STATUS ".. SKIPPING Example ${EXAMPLE_NAME}, OpenCV not found" ) endif(OpenCV_FOUND) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 3f5cc54457..9abd8b3abd 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -6,35 +6,36 @@ message( STATUS ) message( STATUS "=============================================================================" ) message( STATUS "== JKQTPlotterLib Build Information ==" ) message( STATUS "=============================================================================" ) -message( STATUS "Version: ${PROJECT_VERSION}") +message( STATUS "Version: ${PROJECT_VERSION}") if (CMAKE_BUILD_TYPE) - message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") + message( STATUS "Build type: ${CMAKE_BUILD_TYPE}") endif(CMAKE_BUILD_TYPE) -message( STATUS "Using CMake: ${CMAKE_VERSION}") -message( STATUS " Generator: ${CMAKE_GENERATOR}") -message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, platform: ${CMAKE_CXX_PLATFORM_ID}" ) -message( STATUS "C++ Standard: C++${CMAKE_CXX_STANDARD}, required: ${CMAKE_CXX_STANDARD_REQUIRED}" ) -message( STATUS "Architecture: ${CMAKE_CXX_LIBRARY_ARCHITECTURE} / ${CMAKE_LIBRARY_ARCHITECTURE}" ) -message( STATUS "System Name: ${CMAKE_SYSTEM_NAME}" ) -message( STATUS "Processor Name: ${CMAKE_SYSTEM_PROCESSOR}" ) -message( STATUS "Using Qt: ${QT_VERSION}" ) -message( STATUS " [at ${QT_DIR}]" ) +message( STATUS "Using CMake: ${CMAKE_VERSION}") +message( STATUS " Generator: ${CMAKE_GENERATOR}") +message( STATUS "Using compiler: ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, platform: ${CMAKE_CXX_PLATFORM_ID}" ) +message( STATUS "C++ Standard: C++ ${JKQtPlotter_QT_CXX_STANDARD}, required: ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED}" ) +message( STATUS "LIB-Architecture: CXX: ${CMAKE_CXX_LIBRARY_ARCHITECTURE} / BASE: ${CMAKE_LIBRARY_ARCHITECTURE}" ) +message( STATUS "bit depth: ${JKQtPlotter_BIT_DEPTH} bit" ) +message( STATUS "System Name: ${CMAKE_SYSTEM_NAME}" ) +message( STATUS "Processor Name: ${CMAKE_SYSTEM_PROCESSOR}" ) +message( STATUS "Using Qt: ${QT_VERSION}" ) +message( STATUS " [at ${QT_DIR}]" ) if(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) - message( STATUS "XITS fonts: LINKED IN" ) + message( STATUS "XITS fonts: LINKED IN" ) else() - message( STATUS "XITS fonts: NOT AVAILABLE IN LIB" ) + message( STATUS "XITS fonts: NOT AVAILABLE IN LIB" ) endif(JKQtPlotter_BUILD_INCLUDE_XITS_FONTS) if(${JKQtPlotter_HAS_NO_PRINTER_SUPPORT}) - message( STATUS "Print support: OFF" ) + message( STATUS "Print support: OFF" ) else() - message( STATUS "Print support: ON" ) + message( STATUS "Print support: ON" ) endif() if (JKQtPlotter_BUILD_WITH_PRECOMPILED_HEADERS) - message( STATUS "Precompiled Header:ON" ) + message( STATUS "Precompiled Header: ON" ) else() - message( STATUS "Precompiled Header:OFF") + message( STATUS "Precompiled Header: OFF") endif() -message( STATUS "Installing to: ${CMAKE_INSTALL_PREFIX}" ) +message( STATUS "Installing to: ${CMAKE_INSTALL_PREFIX}" ) message( STATUS "=============================================================================" ) message( STATUS ) diff --git a/lib/jkqtcommon/CMakeLists.txt b/lib/jkqtcommon/CMakeLists.txt index fc4fe22427..de22101f89 100644 --- a/lib/jkqtcommon/CMakeLists.txt +++ b/lib/jkqtcommon/CMakeLists.txt @@ -98,15 +98,9 @@ include(CMakePackageConfigHelpers) function(JKQtCommon_setDefaultLibOptions TARGETNAME) set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}") target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Xml Qt${QT_VERSION_MAJOR}::Widgets) - if(${QT_VERSION_MAJOR} VERSION_LESS "6") - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 11) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_11) - else() - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 17) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_17) - endif() + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD}) + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED}) + target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE}) if(MINGW) # COMPILER-SETTINGS FOR MINGW target_compile_options(${TARGETNAME} PUBLIC -fexceptions) diff --git a/lib/jkqtfastplotter/CMakeLists.txt b/lib/jkqtfastplotter/CMakeLists.txt index 8ef96e02df..8734d2a132 100644 --- a/lib/jkqtfastplotter/CMakeLists.txt +++ b/lib/jkqtfastplotter/CMakeLists.txt @@ -37,16 +37,9 @@ include(CMakePackageConfigHelpers) function(JKQtFastPlotter_setDefaultLibOptions TARGETNAME) set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}") target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::OpenGL Qt${QT_VERSION_MAJOR}::Widgets) - if(${QT_VERSION_MAJOR} VERSION_LESS "6") - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 11) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_11) - else() - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 17) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_17) - target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::OpenGLWidgets) - endif() + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD}) + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED}) + target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE}) if(MINGW) # COMPILER-SETTINGS FOR MINGW target_compile_options(${TARGETNAME} PUBLIC -fexceptions) diff --git a/lib/jkqtmathtext/CMakeLists.txt b/lib/jkqtmathtext/CMakeLists.txt index 223017605e..8ae17eca9a 100644 --- a/lib/jkqtmathtext/CMakeLists.txt +++ b/lib/jkqtmathtext/CMakeLists.txt @@ -92,15 +92,9 @@ include(CMakePackageConfigHelpers) function(JKQtMathText_setDefaultLibOptions TARGETNAME) set_property(TARGET ${TARGETNAME} PROPERTY VERSION "${PROJECT_VERSION}") target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Widgets) - if(${QT_VERSION_MAJOR} VERSION_LESS "6") - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 11) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_11) - else() - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 17) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_17) - endif() + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD}) + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED}) + target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE}) if(MINGW) # COMPILER-SETTINGS FOR MINGW target_compile_options(${TARGETNAME} PUBLIC -fexceptions) diff --git a/lib/jkqtplotter/CMakeLists.txt b/lib/jkqtplotter/CMakeLists.txt index d033146ca4..6c1afa7c23 100644 --- a/lib/jkqtplotter/CMakeLists.txt +++ b/lib/jkqtplotter/CMakeLists.txt @@ -199,15 +199,10 @@ function(JKQtPlottter_setDefaultLibOptions TARGETNAME) target_link_libraries(${TARGETNAME} PUBLIC Qt${QT_VERSION_MAJOR}::PrintSupport) target_compile_definitions(${TARGETNAME} PUBLIC JKQTPLOTTER_HAS_PRINTSUPPORT) endif() - if(${QT_VERSION_MAJOR} VERSION_LESS "6") - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 11) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_11) - else() - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD 17) - set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED TRUE) - target_compile_features(${TARGETNAME} PUBLIC cxx_std_17) - endif() + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD ${JKQtPlotter_QT_CXX_STANDARD}) + set_property(TARGET ${TARGETNAME} PROPERTY CXX_STANDARD_REQUIRED ${JKQtPlotter_QT_CXX_STANDARD_REQUIRED}) + target_compile_features(${TARGETNAME} PUBLIC ${JKQtPlotter_QT_CXX_COMPILE_FEATURE}) + if(MINGW) # COMPILER-SETTINGS FOR MINGW target_compile_options(${TARGETNAME} PUBLIC -fexceptions)