-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
67 lines (51 loc) · 1.92 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
cmake_minimum_required(VERSION 3.24)
project(playlister3 VERSION 4.0.2.0 LANGUAGES CXX)
include(cmake/get_cpm.cmake)
include(cmake/GetGitRevisionDescription.cmake)
get_git_head_revision(GIT_REFSPEC GIT_COMMIT_HASH)
if (NOT GIT_REFSPEC)
set(GIT_REFSPEC "release")
endif()
string(REPLACE "refs/heads/" "" GIT_BRANCH_NAME ${GIT_REFSPEC})
string(SUBSTRING ${GIT_COMMIT_HASH} 0 8 GIT_COMMIT_HASH_SHORT)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
CPMAddPackage(
NAME spdlog
GIT_TAG v1.11.0
GITHUB_REPOSITORY gabime/spdlog
)
CPMAddPackage(
NAME zydis
GIT_TAG v4.0.0
GITHUB_REPOSITORY zyantific/zydis
OPTIONS "ZYDIS_MINIMAL_MODE ON" "ZYDIS_FEATURE_ENCODER OFF" "ZYDIS_FEATURE_FORMATTER OFF"
"ZYDIS_FEATURE_AVX512 OFF" "ZYDIS_FEATURE_KNC OFF" "ZYDIS_FEATURE_SEGMENT OFF"
)
CPMAddPackage(
NAME safetyhook
GIT_TAG v0.4.1
GITHUB_REPOSITORY cursey/safetyhook
)
CPMAddPackage(
NAME yaml-cpp
GIT_TAG yaml-cpp-0.7.0
GITHUB_REPOSITORY jbeder/yaml-cpp
OPTIONS "YAML_CPP_BUILD_CONTRIB OFF" "YAML_CPP_BUILD_TOOLS OFF"
)
add_library(${PROJECT_NAME} SHARED
src/init.cc
src/playlists.cc
res/playlister.rc
)
file(GLOB OFFSETS src/offsets/*.cc)
foreach (OFFSET_PATH ${OFFSETS})
message(STATUS "Including version support file: ${OFFSET_PATH}...")
file(READ "${OFFSET_PATH}" CONTENT)
set(ALL_OFFSETS "${ALL_OFFSETS}\n${CONTENT}")
endforeach ()
configure_file(src/version.h.in macros/version.h @ONLY)
configure_file(src/offsets.h.in macros/offsets.h @ONLY)
target_link_libraries(${PROJECT_NAME} spdlog safetyhook yaml-cpp)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
target_precompile_headers(${PROJECT_NAME} PRIVATE src/pch.h)
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/macros)