|
1 | 1 | cmake_minimum_required(VERSION 3.21) |
| 2 | + |
| 3 | +# Set C++ standard and project properties |
2 | 4 | set(CMAKE_CXX_STANDARD 20) |
3 | 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
4 | 6 | set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") |
5 | 7 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) |
6 | 8 |
|
7 | 9 | project(Geodify VERSION 1.0.0) |
8 | 10 |
|
| 11 | +# Collect source files |
9 | 12 | file(GLOB_RECURSE SOURCES src/*.cpp) |
10 | 13 |
|
| 14 | +# Define the shared library target |
11 | 15 | add_library(${PROJECT_NAME} SHARED ${SOURCES}) |
12 | 16 |
|
| 17 | +# Ensure Geode SDK is available |
13 | 18 | if (NOT DEFINED ENV{GEODE_SDK}) |
14 | 19 | message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode") |
15 | 20 | else() |
16 | 21 | message(STATUS "Found Geode: $ENV{GEODE_SDK}") |
17 | 22 | endif() |
18 | 23 |
|
| 24 | +# Special case for GitHub Actions |
19 | 25 | if (DEFINED ENV{GITHUB_ACTIONS}) |
20 | 26 | message("Github Actions Build") |
21 | 27 | add_definitions(-DGITHUB_ACTIONS) |
22 | 28 | endif() |
23 | 29 |
|
| 30 | +# Include CPM.cmake |
24 | 31 | include("cmake/CPM.cmake") |
25 | 32 |
|
26 | | -# Fetch the external-hook-api package |
27 | | -CPMAddPackage("gh:OmgRod/External-Hook-API#master") |
| 33 | +# Fetch the external-hook-api package using the new CPM syntax |
| 34 | +CPMAddPackage( |
| 35 | + NAME external-hook-api |
| 36 | + GIT_REPOSITORY https://github.com/OmgRod/External-Hook-API.git |
| 37 | + GIT_TAG master |
| 38 | +) |
28 | 39 |
|
29 | | -# Add your Geode SDK as a subdirectory |
| 40 | +# Add Geode SDK as a subdirectory |
30 | 41 | add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode) |
31 | 42 |
|
32 | | -# Link the external-hook-api target to your project using the same style |
| 43 | +# Link the external-hook-api target to your project |
33 | 44 | target_link_libraries(${PROJECT_NAME} external-hook-api) |
34 | 45 |
|
35 | 46 | # Setup Geode module (if applicable) |
|
0 commit comments