2022-06-19 20:35:56 +00:00
|
|
|
cmake_minimum_required(VERSION 3.21)
|
|
|
|
message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
|
|
|
|
|
|
|
|
########################################################################################################################
|
|
|
|
## Define project
|
|
|
|
########################################################################################################################
|
|
|
|
project(
|
2022-06-30 10:31:01 +00:00
|
|
|
ArtifactTracker
|
2022-06-19 20:35:56 +00:00
|
|
|
VERSION 1.0.0
|
|
|
|
DESCRIPTION "Eddoursul's Artifact Tracker"
|
|
|
|
LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 23)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)
|
|
|
|
|
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.rc.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
set(sources
|
|
|
|
src/Main.cpp
|
|
|
|
src/Papyrus.cpp
|
2022-06-27 11:38:49 +00:00
|
|
|
src/ArtifactTracker.cpp
|
|
|
|
src/EventListener.cpp
|
2022-06-21 21:51:57 +00:00
|
|
|
src/BookCheck.cpp
|
2022-06-19 20:35:56 +00:00
|
|
|
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/version.rc)
|
|
|
|
|
|
|
|
source_group(
|
|
|
|
TREE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
FILES
|
|
|
|
${headers}
|
|
|
|
${sources})
|
|
|
|
|
|
|
|
########################################################################################################################
|
|
|
|
## Configure target DLL
|
|
|
|
########################################################################################################################
|
|
|
|
find_package(CommonLibSSE CONFIG REQUIRED)
|
|
|
|
|
|
|
|
add_commonlibsse_plugin(${PROJECT_NAME} SOURCES ${headers} ${sources})
|
|
|
|
add_library("${PROJECT_NAME}::${PROJECT_NAME}" ALIAS "${PROJECT_NAME}")
|
|
|
|
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
PRIVATE
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src>
|
|
|
|
$<INSTALL_INTERFACE:src>)
|
|
|
|
|
|
|
|
target_include_directories(${PROJECT_NAME}
|
|
|
|
PUBLIC
|
2022-06-30 10:31:01 +00:00
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
2022-06-19 20:35:56 +00:00
|
|
|
|
|
|
|
target_precompile_headers(${PROJECT_NAME}
|
|
|
|
PRIVATE
|
|
|
|
src/PCH.h)
|
|
|
|
|
|
|
|
install(TARGETS ${PROJECT_NAME}
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
########################################################################################################################
|
|
|
|
## Automatic plugin deployment
|
|
|
|
########################################################################################################################
|
|
|
|
|
|
|
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/")
|
|
|
|
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:${PROJECT_NAME}> "${CMAKE_CURRENT_SOURCE_DIR}/../../SKSE/Plugins/")
|