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

# ${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_JTAG_Static"
					"${OPENIPC_ROOT}/Source/Public_Include"
					"${OPENIPC_ROOT}/Source/Foundation/CommonUtils"
					"${OPENIPC_ROOT}/Source/Foundation/CommonUtils/Public"
					"${OPENIPC_ROOT}/Source/Foundation/JtagLib"
					"${OPENIPC_ROOT}/Source/Components/Probe/Library"
					"${OPENIPC_ROOT}/Source/Foundation/Include"
					"${OPENIPC_ROOT}/Source/Public_Include/Foundation"
					"${OPENIPC_ROOT}/Source/Foundation/StructuredData_Static"
					"${OPENIPC_ROOT}/Source/PluginSDK/Probe/Source/PluginAdapter_static"
					"${OPENIPC_ROOT}/Source/PluginSDK/Probe/Source/SDK/Public"
					"${OPENIPC_ROOT}/Source/Components/Probe/ASD_Connection_Static"
					"${OPENIPC_ROOT}/Source/Components/Probe/ASD_Connection"
					"${IPC_ROOT}/Private/InternalUtils"
					"${OPENIPC_ROOT}/ThirdParty/openssl/include"
					"${OPENIPC_ROOT}/ThirdParty/Boost/1.68.0/include"
					"${OPENIPC_ROOT}/ThirdParty/Xerces-C++/3.2.2/include/"
)

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

if(NEED_SAFE_CLIB)
	include_directories("${SAFECLIB_INCLUDE_DIR}")

	add_definitions( -DNEED_SAFE_CLIB )

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

set_target_properties(ASD_JTAG_Static PROPERTIES
					  OUTPUT_NAME ASD_JTAG_Static_${ARCHITECTURE_NAME}
					  FOLDER "/Components/Probe/ProbePlugins")

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

# Link a target to given libraries.
target_link_libraries(ASD_JTAG_Static PRIVATE InternalUtils ASD_Connection ${CMAKE_DL_LIBS})

