#
# This is CMakeLists for project: Configuration
#
project(Configuration)

# ${SRC} cmake file defines ${SOURCES} variable which holds all sources used during compilation
include_cmake(${SRC})

enable_all_warnings()
enable_warnings_as_errors()

# Adds a library target called <name> to be built from the source files listed in the command invocation.
# The <name> corresponds to the logical target name and must be globally unique within a project.
# The actual file name of the library built is constructed based on conventions of the native platform (such as lib<name>.a or <name>.lib).
add_library(Configuration SHARED ${SOURCES})
UNCRUSTIFY(Configuration ${SOURCES})

target_include_directories(Configuration
	SYSTEM PRIVATE
        "${Boost_INCLUDE_DIRS}"
    )

target_include_directories(Configuration
    PRIVATE
        "${OPENIPC_ROOT}/Source/Public_Include"
    )

set_target_properties(Configuration PROPERTIES
                      OUTPUT_NAME Configuration_${ARCHITECTURE_NAME}
                      DEFINE_SYMBOL CONFIGURATION_EXPORTS
                      FOLDER "/Components")

# Link a target to given libraries.
target_link_libraries(Configuration
    PRIVATE
        Error
        StructuredData
        Logging
        Common
        CommonUtils
        Telemetry
        ${Boost_FILESYSTEM_LIBRARY}
        ${Boost_THREAD_LIBRARY}
        ${Boost_SYSTEM_LIBRARY}
        Threads::Threads
        ${CMAKE_DL_LIBS}
    )

if(UNIX AND NOT APPLE)
    target_link_libraries(Configuration PRIVATE rt)
endif()

install(TARGETS Configuration
        LIBRARY DESTINATION ${DPL_BIN_ROOT} COMPONENT openipc
        RUNTIME DESTINATION ${DPL_BIN_ROOT} COMPONENT openipc)

INSTALL_PDB(Configuration)
