forked from bluetiger9/SmtpClient-for-Qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
48 lines (35 loc) · 1.02 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
cmake_minimum_required(VERSION 3.21)
project(SmtpMime
VERSION 2.0
LANGUAGES C CXX)
option(BUILD_TESTS "builds tests" ON)
option(BUILD_DEMOS "builds demos" ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOUIC OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC OFF)
find_package(QT NAMES Qt6 COMPONENTS Core Network Test REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Network Test REQUIRED)
set(LIBRARY_TARGET_NAME ${PROJECT_NAME})
message("Using Qt" ${QT_VERSION_MAJOR})
#
# Allow -DBUILD_SHARED_LIBS to control the library type built by qt_add_library
#
qt_policy(SET QTP0003 NEW)
#
# Set the default for BUILD_SHARED_LIBS to ON, but allow command line
# to override using -DBUILD_SHARED_LIBS=OFF
#
option(BUILD_SHARED_LIBS "Build as a shared library" ON)
set(CMAKE_INSTALL_RPATH $ORIGIN)
if(BUILD_SHARED_LIBS)
add_compile_options(-DBUILD_SHARED_LIBS)
endif()
add_subdirectory(src)
if (BUILD_TESTS)
add_subdirectory(test)
endif()
if (BUILD_DEMOS)
add_subdirectory(demos)
endif()