cmake_minimum_required(VERSION 3.17)

if (DEFINED ConfigLoadGuard)
    return()
endif()

if (NOT DEFINED CMakeLoggerGuard)
    include(CMakeLogger)
endif()

set(ConfigLoadGuard yes)

include(JSONParser)
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/config.json" CONFIG_JSON)
sbeParseJson(CONFIG CONFIG_JSON)
log_add_entry("Project:")
message("-- Project:")
log_add_entry("--- Name: ${CONFIG.project.name}")
message("--- Name: ${CONFIG.project.name}")
log_add_entry("--- Version: ${CONFIG.project.version}")
message("--- Version: ${CONFIG.project.version}")
log_add_entry("--- Language: ${CONFIG.project.language}")
message("--- Language: ${CONFIG.project.language}")
log_add_entry("--- Mode: ${CONFIG.Mode}")
message("--- Mode: ${CONFIG.Mode}")
log_add_entry("--- Flags: ${CONFIG.${CONFIG.Mode}.${CONFIG.project.language}_FLAGS}")
message("--- Flags: ${CONFIG.${CONFIG.Mode}.${CONFIG.project.language}_FLAGS}")
