mirror of
https://github.com/geode-sdk/example-mod.git
synced 2024-11-28 02:05:33 -05:00
27 lines
710 B
CMake
27 lines
710 B
CMake
cmake_minimum_required(VERSION 3.3.0)
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
project(Template VERSION 1.0.0)
|
|
|
|
# Use GLOB_RECURSE instead of GLOB
|
|
# to recursively add all source files
|
|
# under src/
|
|
file(GLOB SOURCES
|
|
src/*.cpp
|
|
)
|
|
|
|
# Set up the mod binary
|
|
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()
|
|
|
|
set(GEODE_LINK_NIGHTLY ON)
|
|
add_subdirectory($ENV{GEODE_SDK} $ENV{GEODE_SDK}/build)
|
|
|
|
target_link_libraries(${PROJECT_NAME} geode-sdk)
|
|
create_geode_file(${PROJECT_NAME})
|