forked from osoftteam/googleQt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
41 lines (32 loc) · 1.12 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.14)
project(googleQt LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui Network Xml Sql REQUIRED)
if (${QT_VERSION_MAJOR} GREATER 5)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core5Compat REQUIRED)
endif()
add_library(googleQt STATIC)
add_subdirectory(src)
target_include_directories(googleQt PUBLIC src)
target_link_libraries(googleQt
PRIVATE
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::Network
Qt${QT_VERSION_MAJOR}::Xml
Qt${QT_VERSION_MAJOR}::Sql
Qt${QT_VERSION_MAJOR}::Gui
)
if (${QT_VERSION_MAJOR} GREATER 5)
target_link_libraries(googleQt PRIVATE Qt${QT_VERSION_MAJOR}::Core5Compat)
endif()
target_compile_definitions(googleQt PRIVATE _HAS_AUTO_PTR_ETC)
if(${ARD_AUTOTEST} )
target_compile_definitions(googleQt PRIVATE API_QT_AUTOTEST=1)
target_compile_definitions(googleQt PRIVATE API_QT_DIAGNOSTICS=1)
endif()