aboutsummaryrefslogtreecommitdiff
path: root/libraries/systeminfo
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-05-02 21:34:09 +0200
committerSefa Eyeoglu <contact@scrumplex.net>2022-07-10 12:19:14 +0200
commite58158c3cd629717a9742fe08da9b09ed39bc198 (patch)
tree8ed7c850c17f698df8837429f20a16a8a41a153f /libraries/systeminfo
parentff2cd50bfaeaab89ab830f1223c1e3649642dfa3 (diff)
downloadPrismLauncher-e58158c3cd629717a9742fe08da9b09ed39bc198.tar.gz
PrismLauncher-e58158c3cd629717a9742fe08da9b09ed39bc198.tar.bz2
PrismLauncher-e58158c3cd629717a9742fe08da9b09ed39bc198.zip
feat: add Qt 6 support to CMake
Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'libraries/systeminfo')
-rw-r--r--libraries/systeminfo/CMakeLists.txt11
1 files changed, 8 insertions, 3 deletions
diff --git a/libraries/systeminfo/CMakeLists.txt b/libraries/systeminfo/CMakeLists.txt
index d68904f8..33d24605 100644
--- a/libraries/systeminfo/CMakeLists.txt
+++ b/libraries/systeminfo/CMakeLists.txt
@@ -1,6 +1,11 @@
project(systeminfo)
-find_package(Qt5Core)
+if(QT_VERSION_MAJOR EQUAL 5)
+ find_package(Qt5 COMPONENTS Core REQUIRED)
+elseif(Launcher_QT_VERSION_MAJOR EQUAL 6)
+ find_package(Qt6 COMPONENTS Core Core5Compat REQUIRED)
+ list(APPEND systeminfo_LIBS Qt${QT_VERSION_MAJOR}::Core5Compat)
+endif()
set(systeminfo_SOURCES
include/sys.h
@@ -19,7 +24,7 @@ elseif (UNIX)
endif()
add_library(systeminfo STATIC ${systeminfo_SOURCES})
-target_link_libraries(systeminfo Qt5::Core Qt5::Gui Qt5::Network)
+target_link_libraries(systeminfo Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network ${systeminfo_LIBS})
target_include_directories(systeminfo PUBLIC include)
-ecm_add_test(src/sys_test.cpp LINK_LIBRARIES systeminfo Qt5::Test TEST_NAME sys)
+ecm_add_test(src/sys_test.cpp LINK_LIBRARIES systeminfo Qt${QT_VERSION_MAJOR}::Test TEST_NAME sys)