project(ProbePlugin)

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

# Adds -D define flags to the compilation of source files.
# This command can be used to add any flags, but it is intended to add preprocessor definitions
add_definitions(
    -DPROBEPLUGIN_EXPORTS
    )

# 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(ProbePlugin STATIC ${SOURCES} )

set_target_properties(ProbePlugin PROPERTIES
                      OUTPUT_NAME ProbePlugin_${ARCHITECTURE_NAME}
                      FOLDER "/Components/Probe")

target_include_directories(ProbePlugin
    PRIVATE
        "${OPENIPC_ROOT}/Source/Public_Include"
        "${IPC_ROOT}/Private/InternalUtils"
    PUBLIC
        "Public")

# Link a target to given libraries.
target_link_libraries(ProbePlugin PRIVATE InternalUtils
                                          CommonUtils
                                          IndexList_Static
                                          BitData_Static
                                          Threads::Threads
                                          ${CMAKE_DL_LIBS})

if(UNIX AND NOT APPLE)
    target_link_libraries(ProbePlugin PUBLIC rt)
endif()
