forked from dail8859/NotepadNext
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
60 lines (47 loc) · 1.52 KB
/
CMakeLists.txt
File metadata and controls
60 lines (47 loc) · 1.52 KB
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
57
58
59
60
cmake_minimum_required(VERSION 3.21)
project(NotepadAI
VERSION 0.14
DESCRIPTION "Cross-platform text editor"
LANGUAGES C CXX
)
set(APP_DISTRIBUTION "" CACHE STRING "Distribution type")
string(TIMESTAMP CURRENT_YEAR "%Y")
set(APP_COPYRIGHT "Copyright 2019-${CURRENT_YEAR} Justin Dailey, modifications ${CURRENT_YEAR} nullmastermind")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_compile_definitions(SCI_OWNREGEX)
if(MSVC)
# https://stackoverflow.com/questions/78598141/first-stdmutexlock-crashes-in-application-built-with-latest-visual-studio
add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
add_compile_options(/guard:cf)
add_link_options(/guard:cf)
endif()
if(UNIX AND NOT APPLE)
add_compile_options(-fstack-protector-strong -D_FORTIFY_SOURCE=2)
add_link_options(-Wl,-z,relro -Wl,-z,now)
endif()
find_package(Qt6 6.5
REQUIRED
COMPONENTS
Core
Gui
Widgets
Network
PrintSupport
Core5Compat
)
option(NOTEPADAI_BUILD_TESTS "Build unit tests" OFF)
if(NOTEPADAI_BUILD_TESTS)
find_package(Qt6 6.5 REQUIRED COMPONENTS Test)
enable_testing()
endif()
set(CMAKE_AUTORCC ON)
qt_standard_project_setup()
set(CPM_SOURCE_CACHE "${CMAKE_SOURCE_DIR}/.cpm-cache" CACHE PATH "CPM source cache directory")
add_subdirectory(thirdparty)
add_subdirectory(src)
if(NOTEPADAI_BUILD_TESTS)
add_subdirectory(tests)
endif()
include(${CMAKE_SOURCE_DIR}/cmake/Packaging.cmake)