# GMM (C) 2018 Stephane Charette <stephanecharette@gmail.com>
# $Id: CMakeLists.txt 2601 2018-09-15 20:40:24Z stephane $

IF ( WIN32 )

	ADD_CUSTOM_TARGET (
		opc_build
		COMMAND build.bat
		WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
		COMMENT "Building C# console OPC application" VERBATIM )

	FILE ( GLOB OPC_CMD ${CMAKE_CURRENT_SOURCE_DIR}/*.cmd )
	FILE ( GLOB OPC_EXE ${CMAKE_CURRENT_SOURCE_DIR}/OPCConsole/bin/Release/*.exe )
	FILE ( GLOB OPC_DLL ${CMAKE_CURRENT_SOURCE_DIR}/OPCConsole/bin/Release/*.dll )

	SET ( OPC_FILES ${OPC_CMD} ${OPC_EXE} ${OPC_DLL} )
	LIST ( SORT OPC_FILES )

	FOREACH ( OPC_FILE ${OPC_FILES} )
		MESSAGE ( "OPC file to install: ${OPC_FILE}" )
		INSTALL ( FILES ${OPC_FILE} DESTINATION bin )
	ENDFOREACH ()

	# NOTE:  The user will be required to have the Microsoft .NET Runtime which can be found here:  https://www.microsoft.com/net/download

ENDIF ()
