improved CMAKE Library Export script

This commit is contained in:
jkriege2 2022-07-19 14:42:41 +02:00
parent 1e81d58968
commit 74c2e3edf1
2 changed files with 7 additions and 3 deletions

View File

@ -17,14 +17,19 @@ endif()
set(JKQtPlotter_HAS_NO_PRINTER_SUPPORT FALSE)
set(JKQTPLOTTER_PRINTSUPPORT_LIBSTRING "PrintSupport")
if(JKQtPlotter_BUILD_FORCE_NO_PRINTER_SUPPORT)
set(JKQtPlotter_HAS_NO_PRINTER_SUPPORT TRUE)
set(JKQTPLOTTER_PRINTSUPPORT_LIBSTRING "")
else()
if(TARGET Qt${QT_VERSION_MAJOR}::PrintSupport)
else()
set(JKQtPlotter_HAS_NO_PRINTER_SUPPORT TRUE)
set(JKQTPLOTTER_PRINTSUPPORT_LIBSTRING "")
endif()
if(${QT_VERSION_MAJOR} VERSION_LESS "5" )
set(JKQtPlotter_HAS_NO_PRINTER_SUPPORT FALSE)
set(JKQTPLOTTER_PRINTSUPPORT_LIBSTRING "PrintSupport")
endif()
endif()

View File

@ -5,9 +5,8 @@
# Copyright: (c) Jan Krieger <jan@jkrieger.de>
#
# package requires Qt 5/6
find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core Gui Widgets Svg Xml OpenGL REQUIRED)
find_package(Qt@QT_VERSION_MAJOR@ OPTIONAL_COMPONENTS PrintSupport)
# package requires Qt @QT_VERSION_MAJOR@
find_package(Qt@QT_VERSION_MAJOR@ COMPONENTS Core Gui Widgets Svg Xml OpenGL @JKQTPLOTTER_PRINTSUPPORT_LIBSTRING@ REQUIRED)
find_package(JKQTCommon@JKQTP_CURRENT_TARGET_SHAREDPART@Lib REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})
find_package(JKQTMathText@JKQTP_CURRENT_TARGET_SHAREDPART@Lib REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH})