# Copyright (C) 2007  University of Rostock
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA.

CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/ws4d_config.h.in
               ${CMAKE_CURRENT_BINARY_DIR}/ws4d_config.h
               @ONLY)

IF("${DPWS_VERSION}" STREQUAL "2006_02")

################################################################################
# 2006/02 version                                                              #
################################################################################

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dpws.nsmap
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/dpws_2006_02.nsmap ${CMAKE_CURRENT_BINARY_DIR}/dpws.nsmap)

ELSEIF("${DPWS_VERSION}" STREQUAL "2009_01")

################################################################################
# 2009/01 version                                                              #
################################################################################

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dpws.nsmap
    COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/dpws_2009_01.nsmap ${CMAKE_CURRENT_BINARY_DIR}/dpws.nsmap)

ENDIF("${DPWS_VERSION}" STREQUAL "2006_02")

ADD_CUSTOM_TARGET(gen_nsmaps DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/dpws.nsmap)

GEN_PROBES(${CMAKE_CURRENT_SOURCE_DIR}/ws4d_probes.d ${CMAKE_CURRENT_BINARY_DIR}/ws4d_probes.h)

INSTALL(FILES
	${CMAKE_CURRENT_BINARY_DIR}/dpws.nsmap
	soap_misc.h
	${CMAKE_CURRENT_BINARY_DIR}/ws4d_config.h
	stddpws.h
	dpws_client.h
	dpws_device.h
	dpws_hosted.h
	dpws_peer.h
	ws-addressing.h
	ws-discovery.h
	ws-eventing.h
	ws-metadataexchange.h
	ws4d_abstract_eprlist.h
	ws4d_mm.h
	ws4d_base64.h
	ws4d_eprflist.h
	ws4d_eprllist.h
	ws4d_target.h
	ws4d_service.h
	ws4d_targetcache.h
	ws4d_servicecache.h
	ws4d_targetservice.h
	ws4d_hostingservice.h
	ws4d_discovery_ctx.h
	ws4d_uri.h
	ws4d_misc.h
	ws4d_mutex.h
	ws4d_list.h
	ws4d_alloclist.h
	ws4d_stringlist.h
	ws4d_time.h
	ws4d_uuid.h
	ws4d_qname.h
	ws4d_epr.h
	ws4d_device_description.h
	ws4d_localizedstring.h
	ws4d_error.h
	ws4d_epr_kv.h
	ws4d_subscription.h
	ws4d_subsmanager.h
	ws4d_subsmanproxy.h
	ws4d_tracker_worker.h
	ws4d_device_tracker.h
	ws4d_service_tracker.h
	DESTINATION include/ws4d-gSOAP)

IF(WITH_WS4D_SECURITY_SHELL)
    INSTALL(FILES
    	authentication_service.h
    	authentication_service_usage.h
    	security_engine.h
    	security_shell_types.h
    	security_handler.h
    	DESTINATION include/ws4d-gSOAP)
	INSTALL(FILES
	    soapH.h
	    DESTINATION ${GSOAP_INCLUDE_DIR}/plugin)
ENDIF(WITH_WS4D_SECURITY_SHELL)
