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

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

include_directories("${OPENIPC_ROOT}/Source/PluginSDK/Probe/Source/SDK/Public"
			"${OPENIPC_ROOT}/Source/Public_Include"
			"${OPENIPC_ROOT}/Source/Components/Probe/ASD_JTAG_Static"
			"${OPENIPC_ROOT}/../IPC/Private/InternalUtils"
            "${OPENIPC_ROOT}/ThirdParty/openssl/include"
            "${OPENIPC_ROOT}/ThirdParty/Boost/1.68.0/include"
			"${OPENIPC_ROOT}/ThirdParty/Xerces-C++/3.2.2/include/"
			"${OPENIPC_ROOT}/Source/Foundation/CommonUtils/Public"
            "${OPENIPC_ROOT}/Source/Foundation/StructuredData_Static"
            "${OPENIPC_ROOT}/Source/Components/Probe/ASD_Connection_Static"
)


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

set_target_properties(ASD_Connection_Static PROPERTIES
					  OUTPUT_NAME ASD_Connection_Static_${ARCHITECTURE_NAME}
					  FOLDER "/Components/Probe/ProbePlugins"
)

if(WIN32)
		target_compile_options(ASD_Connection_Static PUBLIC /EHsc)
endif()

# Link a target to given libraries.
target_link_libraries(ASD_Connection_Static PRIVATE ${CRYPTO_LIBRARIES} ${SSL_LIBRARIES} ${CMAKE_DL_LIBS})


if(NEED_SAFE_CLIB)

include_directories("${SAFECLIB_INCLUDE_DIR}")

add_definitions( -DNEED_SAFE_CLIB )

target_link_libraries(ASD_Connection_Static PRIVATE
         ${SAFECLIB_ROOT_DIR}/${SYSTEM_NAME}/libsafec.a )

endif()
