-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathCMakeLists.txt
53 lines (46 loc) · 1.58 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
42
43
44
45
46
47
48
49
50
51
52
53
cmake_minimum_required(VERSION 3.0)
message(STATUS "CMake version is ${CMAKE_VERSION}")
if (DEFINED CMAKE_BUILD_TYPE)
message(STATUS "CMake build type is ${CMAKE_BUILD_TYPE}")
endif()
set(CMAKE_CXX_EXTENSIONS OFF)
project(
QtAwsSdk
VERSION 0.4
DESCRIPTION "Unnoficial AWS SDK for Qt"
#HOMEPAGE_URL "https://github.com/pcolby/aws-sdk-qt"
LANGUAGES CXX)
# Disable automatic ASCII conversions.
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII)
# Enable most compiler warnings, and treat as errors.
if (MSVC)
add_compile_options(/W4 /WX)
else()
add_compile_options(-Wall -Wextra -Werror)
endif()
# Default to Qt6 where available, otherwise Qt5.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
find_package(QT REQUIRED COMPONENTS Core Network NAMES Qt6 Qt5)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Network)
message(STATUS "Found Qt ${Qt${QT_VERSION_MAJOR}_VERSION}")
# Include the codegen sub-project if Grantlee is found.
# If BUILD_CODEGEN is "AUTO" we'll only look for Grantlee with Qt5, since Grantlee is
# not usually available for Qt6 yet.
set(BUILD_CODEGEN AUTO CACHE BOOL "Build codegen sub-project")
if (BUILD_CODEGEN AND ((NOT BUILD_CODEGEN STREQUAL AUTO) OR (QT_VERSION_MAJOR EQUAL 5)))
if (BUILD_CODEGEN)
find_package(Grantlee5 REQUIRED)
else()
find_package(Grantlee5 QUIET)
endif()
if (Grantlee5_FOUND)
message(STATUS "Found Grantlee ${Grantlee5_VERSION}")
add_subdirectory(codegen)
else()
message("Grantlee not found; codegen sub-project skipped")
endif()
endif()
add_subdirectory(doc)
add_subdirectory(src)
add_subdirectory(test)