cmake_minimum_required(VERSION 3.20) project(MobileCommand VERSION 0.1.0 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # Export compile commands for IDE support set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # ============================================================================ # GroveEngine Integration # ============================================================================ set(GROVE_BUILD_TESTS OFF CACHE BOOL "Disable GroveEngine tests" FORCE) set(GROVE_BUILD_MODULES OFF CACHE BOOL "Disable GroveEngine modules" FORCE) add_subdirectory(external/GroveEngine) # ============================================================================ # Dependencies # ============================================================================ include(FetchContent) # ============================================================================ # Main Executable # ============================================================================ add_executable(mobilecommand src/main.cpp ) target_link_libraries(mobilecommand PRIVATE GroveEngine::impl spdlog::spdlog ) target_include_directories(mobilecommand PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src ) # ============================================================================ # Hot-Reloadable Modules (.so/.dll) - Game modules # ============================================================================ # GameModule - Core game loop add_library(GameModule SHARED src/modules/GameModule.cpp ) target_link_libraries(GameModule PRIVATE GroveEngine::impl spdlog::spdlog ) set_target_properties(GameModule PROPERTIES PREFIX "lib" LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/modules ) # ============================================================================ # Copy config files to build directory # ============================================================================ file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/config/ DESTINATION ${CMAKE_BINARY_DIR}/config) # ============================================================================ # Development targets # ============================================================================ # Quick rebuild of modules only (for hot-reload workflow) add_custom_target(modules DEPENDS GameModule COMMENT "Building hot-reloadable modules only" ) # Run MobileCommand add_custom_target(run COMMAND $ DEPENDS mobilecommand modules WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Running Mobile Command" )