mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-23 11:36:54 -04:00
#221 Use cmake import targets for the Qt dependency (Xml), props Schaich Alonso
This commit is contained in:
parent
7a7210cfa1
commit
c875371289
2 changed files with 20 additions and 37 deletions
|
@ -108,18 +108,9 @@ if($ENV{CMAKE_PREFIX_PATH} MATCHES "6[.][0-9][.][0-9]")
|
||||||
find_package(Qt6Widgets)
|
find_package(Qt6Widgets)
|
||||||
find_package(Qt6Gui)
|
find_package(Qt6Gui)
|
||||||
find_package(Qt6UiTools)
|
find_package(Qt6UiTools)
|
||||||
|
find_package(Qt6Xml)
|
||||||
|
|
||||||
if(Qt6Widgets_FOUND AND Qt6Gui_FOUND AND Qt6UiTools_FOUND)
|
if(Qt6Widgets_FOUND AND Qt6Gui_FOUND AND Qt6UiTools_FOUND AND Qt6Xml_FOUND)
|
||||||
set(QT_USE_QTGUI TRUE)
|
|
||||||
set(QT_USE_QTUITOOLS TRUE)
|
|
||||||
set(QT_USE_QTXML TRUE)
|
|
||||||
include_directories(
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${Qt6Widgets_INCLUDES}
|
|
||||||
${Qt6Gui_INCLUDES}
|
|
||||||
${Qt6UiTools_INCLUDES}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
add_subdirectory(frontend_qt)
|
add_subdirectory(frontend_qt)
|
||||||
else()
|
else()
|
||||||
message(STATUS "Could NOT find Qt6")
|
message(STATUS "Could NOT find Qt6")
|
||||||
|
@ -129,18 +120,9 @@ else()
|
||||||
find_package(Qt5Widgets)
|
find_package(Qt5Widgets)
|
||||||
find_package(Qt5Gui)
|
find_package(Qt5Gui)
|
||||||
find_package(Qt5UiTools)
|
find_package(Qt5UiTools)
|
||||||
|
find_package(Qt5Xml)
|
||||||
|
|
||||||
if(Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND)
|
if(Qt5Widgets_FOUND AND Qt5Gui_FOUND AND Qt5UiTools_FOUND AND Qt5Xml_FOUND)
|
||||||
set(QT_USE_QTGUI TRUE)
|
|
||||||
set(QT_USE_QTUITOOLS TRUE)
|
|
||||||
set(QT_USE_QTXML TRUE)
|
|
||||||
include_directories(
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
|
||||||
${Qt5Widgets_INCLUDES}
|
|
||||||
${Qt5Gui_INCLUDES}
|
|
||||||
${Qt5UiTools_INCLUDES}
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
)
|
|
||||||
add_subdirectory(frontend_qt)
|
add_subdirectory(frontend_qt)
|
||||||
else()
|
else()
|
||||||
message(STATUS "Could NOT find Qt5")
|
message(STATUS "Could NOT find Qt5")
|
||||||
|
@ -158,14 +140,15 @@ add_custom_target(uninstall
|
||||||
# staniek: don't install
|
# staniek: don't install
|
||||||
if(DATA_INSTALL_DIR)
|
if(DATA_INSTALL_DIR)
|
||||||
set(CMAKE_MODULES_INSTALL_PATH ${DATA_INSTALL_DIR}/cmake/modules)
|
set(CMAKE_MODULES_INSTALL_PATH ${DATA_INSTALL_DIR}/cmake/modules)
|
||||||
else (DATA_INSTALL_DIR)
|
else()
|
||||||
set(CMAKE_MODULES_INSTALL_PATH ${CMAKE_ROOT}/Modules)
|
set(CMAKE_MODULES_INSTALL_PATH ${CMAKE_ROOT}/Modules)
|
||||||
endif(DATA_INSTALL_DIR)
|
endif()
|
||||||
|
|
||||||
install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_MODULES_INSTALL_PATH} COMPONENT Devel)
|
install(FILES cmake/modules/FindZint.cmake DESTINATION ${CMAKE_MODULES_INSTALL_PATH} COMPONENT Devel)
|
||||||
|
|
||||||
# This needs to be run very last so other parts of the scripts can take
|
# This needs to be run very last so other parts of the scripts can take
|
||||||
# advantage of this.
|
# advantage of this.
|
||||||
IF(NOT ZINT_HAS_BEEN_RUN_BEFORE)
|
if(NOT ZINT_HAS_BEEN_RUN_BEFORE)
|
||||||
SET(ZINT_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
set(ZINT_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL
|
||||||
ENDIF(NOT ZINT_HAS_BEEN_RUN_BEFORE)
|
"Flag to track whether this is the first time running CMake or if CMake has been configured before")
|
||||||
|
endif()
|
||||||
|
|
|
@ -28,9 +28,9 @@ add_dependencies(zint-qt zint)
|
||||||
link_directories( "${CMAKE_BINARY_DIR}/backend" )
|
link_directories( "${CMAKE_BINARY_DIR}/backend" )
|
||||||
|
|
||||||
if(USE_QT6)
|
if(USE_QT6)
|
||||||
target_link_libraries(zint-qt zint Qt6::UiTools ${QT_QTXML_LIBRARY} Qt6::Gui Qt6::Core)
|
target_link_libraries(zint-qt zint Qt6::UiTools Qt6::Xml Qt6::Gui Qt6::Core)
|
||||||
else()
|
else()
|
||||||
target_link_libraries(zint-qt zint Qt5::UiTools ${QT_QTXML_LIBRARY} Qt5::Gui Qt5::Core)
|
target_link_libraries(zint-qt zint Qt5::UiTools Qt5::Xml Qt5::Gui Qt5::Core)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
install(TARGETS zint-qt DESTINATION "${BIN_INSTALL_DIR}" RUNTIME)
|
install(TARGETS zint-qt DESTINATION "${BIN_INSTALL_DIR}" RUNTIME)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue