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

# ${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/Public_Include"
	"${OPENIPC_ROOT}/Source/Foundation/CommonUtils"
	"${OPENIPC_ROOT}/Source/Foundation/JtagLib"
	"${OPENIPC_ROOT}/Source/Components/Probe/Library"
	"${IPC_ROOT}/Private/InternalUtils"
	"${OPENIPC_ROOT}/Source/Foundation/Include"
	"${OPENIPC_ROOT}/Source/Public_Include/Foundation"
	"${OPENIPC_ROOT}/ThirdParty/Xerces-C++/3.2.2/include/"
	"${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(ProbePluginASD_JTAG SHARED ${SOURCES} )

set_target_properties(ProbePluginASD_JTAG PROPERTIES
					  OUTPUT_NAME ProbePluginASD_JTAG_${ARCHITECTURE_NAME}
					  FOLDER "/Components/Probe/ProbePlugins")

# Link a target to given libraries.
target_link_libraries(ProbePluginASD_JTAG PRIVATE	InternalUtils
							ASD_JTAG_Static
							StructuredData_Static
							ProbePlugin
							JtagLib
)

if(WIN32)
  target_link_libraries(ProbePluginASD_JTAG PRIVATE)
endif()

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

INSTALL_PDB(ProbePluginASD_JTAG ${DPL_BIN_ROOT} openipc)
