forked from ccldrepo/ModFunctionMenu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
133 lines (112 loc) · 3.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
cmake_minimum_required(VERSION 3.28)
project(
ccld_ModFunctionMenu
VERSION 1.5.0
DESCRIPTION "SKSE plugin that provide an elegant interface to invoke mod function."
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION "$<$<CONFIG:Release>:ON>")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in"
"${CMAKE_CURRENT_BINARY_DIR}/version.rc"
@ONLY
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ccld_ModFunctionMenu.toml"
"${CMAKE_CURRENT_BINARY_DIR}/ccld_ModFunctionMenu.toml"
COPYONLY
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ccld_ModFunctionMenu_fonts.toml"
"${CMAKE_CURRENT_BINARY_DIR}/ccld_ModFunctionMenu_fonts.toml"
COPYONLY
)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/ccld_ModFunctionMenu_styles.toml"
"${CMAKE_CURRENT_BINARY_DIR}/ccld_ModFunctionMenu_styles.toml"
COPYONLY
)
# -- Declare Sources -----------------------------------------------------------
include(cmake/headerlist.cmake)
include(cmake/sourcelist.cmake)
source_group(
TREE
"${CMAKE_CURRENT_SOURCE_DIR}"
FILES
${PROJECT_HEADERS}
${PROJECT_SOURCES}
)
# -- Declare Dependencies ------------------------------------------------------
if(NOT CMAKE_PREFIX_PATH AND DEFINED ENV{DEV_INSTALL_PATH})
cmake_path(SET CMAKE_PREFIX_PATH "$ENV{DEV_INSTALL_PATH}/${CMAKE_BUILD_TYPE}")
endif()
set(ZLIB_USE_STATIC_LIBS "ON")
find_package(CommonLibSSE REQUIRED)
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(tomlplusplus REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
find_package(Freetype REQUIRED)
find_package(absl REQUIRED)
# -- Declare Targets -----------------------------------------------------------
add_commonlibsse_plugin(
"${PROJECT_NAME}"
SOURCES
${PROJECT_HEADERS}
${PROJECT_SOURCES}
"${CMAKE_CURRENT_BINARY_DIR}/version.rc"
)
target_compile_definitions(
"${PROJECT_NAME}"
PRIVATE
_UNICODE
NOMINMAX
IMGUI_USER_CONFIG=<imconfig_user.h>
)
target_compile_features(
"${PROJECT_NAME}"
PRIVATE
cxx_std_23
)
if(MSVC)
target_compile_options(
"${PROJECT_NAME}"
PRIVATE
/EHsc
/permissive-
/sdl
/utf-8
/W4
/Zc:__cplusplus
/Zc:preprocessor
)
endif()
target_include_directories(
"${PROJECT_NAME}"
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/src"
"${CMAKE_CURRENT_SOURCE_DIR}/vendor"
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/backends"
"${CMAKE_CURRENT_SOURCE_DIR}/vendor/misc/freetype"
)
target_link_libraries(
"${PROJECT_NAME}"
PRIVATE
fmt::fmt
spdlog::spdlog
tomlplusplus::tomlplusplus
ZLIB::ZLIB
PNG::PNG
Freetype::Freetype
absl::cleanup
absl::flat_hash_map
absl::strings
)
target_precompile_headers(
"${PROJECT_NAME}"
PRIVATE
"src/XSEPlugin/PCH.h"
)