-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·72 lines (54 loc) · 2.06 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
68
69
70
71
72
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
project(CreationRotation VERSION 1.0.0)
file(GLOB_RECURSE SOURCES src/*.cpp)
add_library(${PROJECT_NAME} SHARED ${SOURCES})
if (NOT DEFINED ENV{GEODE_SDK})
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
else()
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
endif()
target_include_directories(${PROJECT_NAME} PRIVATE src/)
add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)
option(CR_DEBUG "Debug mode" OFF)
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CR_DEBUG ON)
add_compile_definitions(CR_DEBUG=1)
endif()
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_compile_definitions(WIN32_LEAN_AND_MEAN=1)
target_link_libraries(${PROJECT_NAME} Crypt32)
endif()
set(USE_ZLIB OFF)
if (NOT APPLE)
set(USE_MBED_TLS ON)
endif()
set(USE_OPEN_SSL OFF)
set(USE_TLS ON)
SET(CMAKE_C_SIMULATE_ID "Clang")
set(ENABLE_PROGRAMS OFF)
set(ENABLE_TESTING OFF)
set(MBEDTLS_AS_SUBPROJECT OFF)
set(DISABLE_PACKAGE_CONFIG_AND_INSTALL OFF)
set(MBEDTLS_FATAL_WARNINGS OFF)
CPMAddPackage("gh:TechStudent10/mbedtls#fc79213")
set(MBEDTLS_INCLUDE_DIRS "${mbedtls_SOURCE_DIR}/include")
set(MBEDTLS_LIBRARY "mbedtls")
set(MBEDX509_LIBRARY "mbedx509")
set(MBEDCRYPTO_LIBRARY "mbedcrypto")
CPMAddPackage("gh:machinezone/IXWebSocket#dc8807e")
install(TARGETS mbedtls mbedx509 mbedcrypto EXPORT mbedtls-targets)
if (WIN32)
if (CR_DEBUG)
target_compile_definitions(mbedtls PRIVATE _HAS_ITERATOR_DEBUGGING=0)
target_compile_definitions(ixwebsocket PRIVATE _HAS_ITERATOR_DEBUGGING=0)
endif()
endif()
target_compile_definitions(${PROJECT_NAME} PRIVATE CR_EXPORTING)
target_include_directories(${PROJECT_NAME} PRIVATE ${ixwebsocket_SOURCE_DIR})
target_include_directories(${PROJECT_NAME} PRIVATE "${CMAKE_SOURCE_DIR}/ext/cereal/include")
target_link_libraries(${PROJECT_NAME} ixwebsocket)
setup_geode_mod(${PROJECT_NAME})