1
artifact-tracker/Source/ArtifactTrackerDLL/CMakeLists.txt

72 lines
2.6 KiB
CMake
Raw Normal View History

2022-06-19 20:35:56 +00:00
cmake_minimum_required(VERSION 3.21)
message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
########################################################################################################################
## Define project
########################################################################################################################
project(
ArtifactTrackerFunctions
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-21 21:51:57 +00:00
src/BookCheck.cpp
2022-06-22 00:52:12 +00:00
src/MiscCheck.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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
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/")