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

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

# Add the given directories to those the compiler uses to search for include files.
# Relative paths are interpreted as relative to the current source directory.
include_directories(
				"${OPENIPC_ROOT}/Source/Components/Probe/ASD_Connection"
				"${OPENIPC_ROOT}/../IPC/Private/InternalUtils"
				"${OPENIPC_ROOT}/Source/PluginSDK/Probe/Source/SDK/Public"
				"${OPENIPC_ROOT}/Source/Foundation/CommonUtils/Public"
				"${OPENIPC_ROOT}/Source/Foundation/StructuredData_Static"
)

if(NEED_SAFE_CLIB)
include_directories("$(SAFECLIB_INCLUDE_DIR)")
endif()


# 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(ASD_Connection SHARED ${SOURCES} )

set_target_properties(ASD_Connection PROPERTIES
					  OUTPUT_NAME ASD_Connection_${ARCHITECTURE_NAME}
					  FOLDER "/Components/Probe/ProbePlugins")

# Link a target to given libraries.
target_link_libraries(ASD_Connection PRIVATE ASD_Connection_Static StructuredData_Static ProbePlugin ${SSL_LIBRARIES})

if(WIN32)
  target_link_libraries(ASD_Connection PRIVATE wsock32 ws2_32)
endif()

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

INSTALL_PDB(ASD_Connection ${DPL_BIN_ROOT} openipc)
