2017-01-02 00:29:46 +05:30
|
|
|
project(systeminfo)
|
|
|
|
|
2022-05-03 01:04:09 +05:30
|
|
|
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()
|
2017-01-02 00:29:46 +05:30
|
|
|
|
|
|
|
set(systeminfo_SOURCES
|
|
|
|
include/sys.h
|
2018-03-12 03:30:54 +05:30
|
|
|
include/distroutils.h
|
|
|
|
src/distroutils.cpp
|
2017-01-02 00:29:46 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
if (WIN32)
|
2018-07-15 18:21:05 +05:30
|
|
|
list(APPEND systeminfo_SOURCES src/sys_win32.cpp)
|
2017-01-02 00:29:46 +05:30
|
|
|
elseif (UNIX)
|
2018-07-15 18:21:05 +05:30
|
|
|
if(APPLE)
|
|
|
|
list(APPEND systeminfo_SOURCES src/sys_apple.cpp)
|
|
|
|
else()
|
|
|
|
list(APPEND systeminfo_SOURCES src/sys_unix.cpp)
|
|
|
|
endif()
|
2017-01-02 00:29:46 +05:30
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(systeminfo STATIC ${systeminfo_SOURCES})
|
2022-05-03 01:04:09 +05:30
|
|
|
target_link_libraries(systeminfo Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Gui Qt${QT_VERSION_MAJOR}::Network ${systeminfo_LIBS})
|
2017-01-02 00:29:46 +05:30
|
|
|
target_include_directories(systeminfo PUBLIC include)
|
|
|
|
|
2022-05-03 01:04:09 +05:30
|
|
|
ecm_add_test(src/sys_test.cpp LINK_LIBRARIES systeminfo Qt${QT_VERSION_MAJOR}::Test TEST_NAME sys)
|