cmake_minimum_required(VERSION 3.20) project(world-generation-realist) set(CMAKE_CXX_STANDARD 20) # Add compiler flags set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0 -fsanitize=address -fsanitize=undefined") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG") # Include directories include_directories(include) include_directories(../../core/include) include_directories(../map/include) # Add FetchContent for dependencies include(FetchContent) # nlohmann/json FetchContent_Declare( nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG v3.11.3 ) FetchContent_MakeAvailable(nlohmann_json) # Source files set(SOURCES src/MeteoriteImpact.cpp src/PlanetaryCore.cpp src/WorldData.cpp src/Meteorite.cpp ) # Create the module library (when sources exist) if(SOURCES) add_library(world-generation-realist SHARED ${SOURCES}) # Link libraries target_link_libraries(world-generation-realist nlohmann_json::nlohmann_json ) # Set output directory set_target_properties(world-generation-realist PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" ) # Install targets install(TARGETS world-generation-realist LIBRARY DESTINATION lib ) endif() # Install headers install(DIRECTORY include/ DESTINATION include/world-generation-realist FILES_MATCHING PATTERN "*.h" )