Change CMakeLists.txt to use list APPEND for Qt5
This commit is contained in:
@@ -122,34 +122,37 @@ endif(WIN32)
|
|||||||
|
|
||||||
# QT
|
# QT
|
||||||
set(QT_MIN_VERSION 5.5)
|
set(QT_MIN_VERSION 5.5)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS Core Concurrent Widgets Network Sql)
|
set(QT_COMPONENTS Core Concurrent Widgets Network Sql)
|
||||||
|
|
||||||
if(X11_FOUND)
|
if(X11_FOUND)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
|
list(APPEND QT_COMPONENTS X11Extras)
|
||||||
endif()
|
endif()
|
||||||
if(DBUS_FOUND)
|
if(DBUS_FOUND)
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus)
|
list(APPEND QT_COMPONENTS DBus)
|
||||||
|
endif()
|
||||||
|
if(APPLE)
|
||||||
|
list(APPEND QT_COMPONENTS MacExtras)
|
||||||
|
endif()
|
||||||
|
if(WIN32)
|
||||||
|
list(APPEND QT_COMPONENTS WinExtras)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED ${QT_COMPONENTS})
|
||||||
|
|
||||||
|
set(QT_LIBRARIES ${Qt5Core_LIBRARIES} ${Qt5Concurrent_LIBRARIES} ${Qt5Widgets_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Sql_LIBRARIES})
|
||||||
|
|
||||||
|
if(Qt5DBus_FOUND)
|
||||||
|
list(APPEND QT_LIBRARIES ${Qt5DBus_LIBRARIES})
|
||||||
get_target_property(QT_DBUSXML2CPP_EXECUTABLE Qt5::qdbusxml2cpp LOCATION)
|
get_target_property(QT_DBUSXML2CPP_EXECUTABLE Qt5::qdbusxml2cpp LOCATION)
|
||||||
endif()
|
endif()
|
||||||
if(APPLE)
|
if(Qt5X11Extras_FOUND)
|
||||||
find_package(Qt5 REQUIRED COMPONENTS MacExtras)
|
list(APPEND QT_LIBRARIES ${Qt5X11Extras_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
if(WIN32)
|
if(Qt5MacExtras_FOUND)
|
||||||
find_package(Qt5 REQUIRED COMPONENTS WinExtras)
|
list(APPEND QT_LIBRARIES ${Qt5MacExtras_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
if(Qt5WinExtras_FOUND)
|
||||||
set(QT_LIBRARIES Qt5::Core Qt5::Concurrent Qt5::Widgets Qt5::Network Qt5::Sql)
|
list(APPEND QT_LIBRARIES ${Qt5WinExtras_LIBRARIES})
|
||||||
|
|
||||||
if(DBUS_FOUND)
|
|
||||||
set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::DBus)
|
|
||||||
endif()
|
|
||||||
if(X11_FOUND)
|
|
||||||
set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::X11Extras)
|
|
||||||
endif()
|
|
||||||
if(APPLE)
|
|
||||||
set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::MacExtras)
|
|
||||||
endif()
|
|
||||||
if(WIN32)
|
|
||||||
set(QT_LIBRARIES ${QT_LIBRARIES} Qt5::WinExtras)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Qt5LinguistTools CONFIG)
|
find_package(Qt5LinguistTools CONFIG)
|
||||||
|
|||||||
Reference in New Issue
Block a user