forked from QtExcel/QXlsx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (44 loc) · 1.45 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
54
55
56
cmake_minimum_required(VERSION 3.16)
project(YXlsx
VERSION 0.1.0
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wconversion -Wno-shorten-64-to-32")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core Gui)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core Gui)
file(GLOB_RECURSE SOURCE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.cc"
)
file(GLOB_RECURSE HEADER_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/header/api/*.h"
"${CMAKE_CURRENT_SOURCE_DIR}/header/utils/*.h"
)
add_library(YXlsx SHARED ${SOURCE_FILES} ${HEADER_FILES})
add_library(YXlsx::YXlsx ALIAS YXlsx)
set_target_properties(YXlsx PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
target_compile_features(YXlsx INTERFACE cxx_std_20)
target_compile_definitions(YXlsx PRIVATE
QT_NO_CAST_TO_ASCII
QT_NO_CAST_FROM_ASCII
QT_NO_URL_CAST_FROM_STRING
QT_NO_CAST_FROM_BYTEARRAY
QT_USE_QSTRINGBUILDER
QT_USE_FAST_OPERATOR_PLUS
QT_DISABLE_DEPRECATED_BEFORE=0x060500
QT_VERSION_MAJOR=6
QT_VERSION_MINOR=5
)
target_link_libraries(${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::GuiPrivate
)
target_include_directories(YXlsx
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/header/api>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/header/utils>
)