-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
37 lines (30 loc) · 1.63 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
cmake_minimum_required(VERSION 3.21)
project(SkyrimScripting.Wait VERSION 0.0.1 LANGUAGES CXX)
option(DEPLOY_MOD "Copy mod .dll and resource into %SKYRIM_MODS_DEPLOY_ROOT%\\${PROJECT_NAME}" OFF)
# Override <DEPLOY_ROOT> to set the path of a mod to deploy files to.
# The SKSE plugin files will be writen to <DEPLOY_ROOT>/<PROJECT_NAME>/SKSE/Plugins
# You can use the environment variable SKYRIM_MODS_DEPLOY_ROOT to set a default <DEPLOY_ROOT>
# set(DEPLOY_ROOT "C:/some/path/to/mod/path")
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
file(GLOB_RECURSE SOURCE_FILES src/*.cpp src/*.h)
find_package(CommonLibSSE CONFIG REQUIRED)
add_commonlibsse_plugin(${PROJECT_NAME} SOURCES ${SOURCE_FILES})
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "!!!!!.SkyrimScripting.Wait")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
target_precompile_headers(${PROJECT_NAME} PUBLIC src/PCH.h)
if(DEPLOY_MOD)
if(EXISTS "${DEPLOY_ROOT}")
set(MOD_FOLDER "${DEPLOY_ROOT}/${PROJECT_NAME}")
set(DLL_FOLDER "${MOD_FOLDER}/SKSE/Plugins")
message(STATUS "Plugin output directory: ${MOD_FOLDER}")
add_custom_command(
TARGET "${PROJECT_NAME}"
POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E make_directory "${DLL_FOLDER}"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_FILE:${PROJECT_NAME}>" "${DLL_FOLDER}/$<TARGET_FILE_NAME:${PROJECT_NAME}>"
COMMAND "${CMAKE_COMMAND}" -E copy_if_different "$<TARGET_PDB_FILE:${PROJECT_NAME}>" "${DLL_FOLDER}/$<TARGET_PDB_FILE_NAME:${PROJECT_NAME}>"
VERBATIM
)
endif()
endif()