-
Notifications
You must be signed in to change notification settings - Fork 1
/
cmake.toml
58 lines (46 loc) · 2.14 KB
/
cmake.toml
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
# Reference: https://build-cpp.github.io/cmkr/cmake-toml
# to build:
# > cmake -B build
# > cmake --build build --config Release
[project]
name = "MW5-UEVR-Plugins"
cmake-before="""
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
"""
cmake-after = """
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(ASMJIT_STATIC ON CACHE BOOL "" FORCE)
if ("${CMAKE_BUILD_TYPE}" MATCHES "Release")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MT")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MT")
# Statically compile runtime
string(REGEX REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
string(REGEX REPLACE "/MD" "/MT" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
string(REGEX REPLACE "/MD" "/MT" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
string(REGEX REPLACE "/MD" "/MT" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
message(NOTICE "Building in Release mode")
endif()
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
#add_subdirectory(dependencies/submodules/UESDK)
"""
[template.plugin]
type = "shared"
compile-features = ["cxx_std_23"]
include-directories = ["include/", "ext/uevr/include/", "ext/glm/"]
[target.HeadAim]
type = "plugin"
sources = ["src/head_aim/**.cpp", "src/head_aim/**.c"]
headers = ["src/head_aim/**.hpp", "src/head_aim/**.h"]
[target.MechShakerBridge]
type = "plugin"
sources = ["src/mechshaker_bridge/**.cpp", "src/mechshaker_bridge/**.c"]
headers = ["src/mechshaker_bridge/**.hpp", "src/mechshaker_bridge/**.h"]
cmake-after="""
add_custom_command(
TARGET HeadAim POST_BUILD
COMMAND powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${CMAKE_SOURCE_DIR}/copy_with_retry.ps1" -sourcePath "${CMAKE_SOURCE_DIR}/build/Release/HeadAim.dll" -destPath "%APPDATA%/UnrealVRMod/MechWarrior-Win64-Shipping/plugins/HeadAim.dll")
add_custom_command(
TARGET MechShakerBridge POST_BUILD
COMMAND powershell.exe -NoProfile -ExecutionPolicy Bypass -File "${CMAKE_SOURCE_DIR}/copy_with_retry.ps1" -sourcePath "${CMAKE_SOURCE_DIR}/build/Release/MechShakerBridge.dll" -destPath "%APPDATA%/UnrealVRMod/MechWarrior-Win64-Shipping/plugins/MechShakerBridge.dll")
"""