-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
67 lines (50 loc) · 2.52 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.16)
project(profui-patch LANGUAGES CXX VERSION 1.1)
# --------------------------------------------------------------------------------------------------------
# Setup Cross-Compilation on Linux
# --------------------------------------------------------------------------------------------------------
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
message(FATAL_ERROR "[${PROJECT_NAME}] Make sure to instruct cmake to use the toolchain file!")
endif()
# --------------------------------------------------------------------------------------------------------
# Create library
# --------------------------------------------------------------------------------------------------------
file(GLOB src "src/*.cpp")
add_library(${PROJECT_NAME} SHARED ${src})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "MSIMG32")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20 CXX_EXTENSIONS OFF CXX_STANDARD_REQUIRED ON)
if (MINGW)
target_link_libraries(${PROJECT_NAME} PRIVATE "-Wl,--enable-stdcall-fixup")
endif()
if (NOT MSVC AND NOT IS_CI)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Werror -pedantic -pedantic-errors -Wfatal-errors)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-cast-function-type -Wno-missing-field-initializers)
endif()
# --------------------------------------------------------------------------------------------------------
# Include directories
# --------------------------------------------------------------------------------------------------------
target_include_directories(${PROJECT_NAME} PUBLIC "include")
# --------------------------------------------------------------------------------------------------------
# Link Dependencies and Add Sources
# --------------------------------------------------------------------------------------------------------
include("cmake/cpm.cmake")
CPMAddPackage(
NAME spdlog
VERSION 1.14.1
GIT_REPOSITORY "https://github.com/gabime/spdlog"
OPTIONS "SPDLOG_WCHAR_SUPPORT ON"
)
CPMAddPackage(
NAME lime
VERSION 6.0
GIT_REPOSITORY "https://github.com/Curve/lime"
)
CPMAddPackage(
NAME lockpp
VERSION 2.8
GIT_REPOSITORY "https://github.com/Curve/lockpp"
)
lime_mingw_generate_proxy(${PROJECT_NAME} "exports.lime")
target_link_libraries(${PROJECT_NAME} PUBLIC cr::lime cr::lockpp spdlog::spdlog)