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)

# Find required packages
find_package(nlohmann_json REQUIRED)

# Source files (empty for now, just interfaces)
set(SOURCES
    # Add source files here when implementations are created
)

# 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"
)