Blame server/CMakeLists.txt

Packit Service 5a9772
# FreeRDP: A Remote Desktop Protocol Implementation
Packit Service 5a9772
# FreeRDP Servers
Packit Service 5a9772
#
Packit Service 5a9772
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
Packit Service 5a9772
#
Packit Service 5a9772
# Licensed under the Apache License, Version 2.0 (the "License");
Packit Service 5a9772
# you may not use this file except in compliance with the License.
Packit Service 5a9772
# You may obtain a copy of the License at
Packit Service 5a9772
#
Packit Service 5a9772
#     http://www.apache.org/licenses/LICENSE-2.0
Packit Service 5a9772
#
Packit Service 5a9772
# Unless required by applicable law or agreed to in writing, software
Packit Service 5a9772
# distributed under the License is distributed on an "AS IS" BASIS,
Packit Service 5a9772
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit Service 5a9772
# See the License for the specific language governing permissions and
Packit Service 5a9772
# limitations under the License.
Packit Service 5a9772
Packit Service 5a9772
# Servers
Packit Service 5a9772
include(CMakeDependentOption)
Packit Service 5a9772
Packit Service 5a9772
CMAKE_DEPENDENT_OPTION(WITH_SHADOW "Compile with shadow server" ON	"WITH_SERVER" OFF)
Packit Service 5a9772
CMAKE_DEPENDENT_OPTION(WITH_PROXY "Compile with proxy server" ON	"WITH_SERVER" OFF)
Packit Service 5a9772
Packit Service 5a9772
add_subdirectory(common)
Packit Service 5a9772
if (WITH_SHADOW)
Packit Service 5a9772
	add_subdirectory(shadow)
Packit Service 5a9772
endif()
Packit Service 5a9772
if (WITH_PROXY)
Packit Service 5a9772
	add_subdirectory(proxy)
Packit Service 5a9772
endif()
Packit Service 5a9772
Packit Service 5a9772
if(FREERDP_VENDOR)
Packit Service 5a9772
	if(WITH_SAMPLE)
Packit Service 5a9772
		add_subdirectory(Sample)
Packit Service 5a9772
	endif()
Packit Service 5a9772
Packit Service 5a9772
	if(NOT WIN32)
Packit Service 5a9772
		if(APPLE AND (NOT IOS))
Packit Service 5a9772
			add_subdirectory(Mac)
Packit Service 5a9772
		endif()
Packit Service 5a9772
	else()
Packit Service 5a9772
                add_subdirectory(Windows)
Packit Service 5a9772
	endif()
Packit Service 5a9772
Packit Service 5a9772
	if(NOT DEFINED WITH_FREERDS)
Packit Service 5a9772
		set(WITH_FREERDS 1)
Packit Service 5a9772
	endif()
Packit Service 5a9772
Packit Service 5a9772
	if(WITH_FREERDS AND (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/FreeRDS"))
Packit Service 5a9772
		add_subdirectory("FreeRDS")
Packit Service 5a9772
	endif()
Packit Service 5a9772
endif()
Packit Service 5a9772
Packit Service 5a9772
# Pick up other servers
Packit Service 5a9772
Packit Service 5a9772
set(FILENAME "ModuleOptions.cmake")
Packit Service 5a9772
file(GLOB FILEPATHS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/${FILENAME}")
Packit Service 5a9772
Packit Service 5a9772
foreach(FILEPATH ${FILEPATHS})
Packit Service 5a9772
	if(${FILEPATH} MATCHES "^([^/]*)/+${FILENAME}")
Packit Service 5a9772
		string(REGEX REPLACE "^([^/]*)/+${FILENAME}" "\\1" FREERDP_SERVER ${FILEPATH})
Packit Service 5a9772
		set(FREERDP_SERVER_ENABLED 0)
Packit Service 5a9772
		include(${FILEPATH})
Packit Service 5a9772
		if(FREERDP_SERVER_ENABLED)
Packit Service 5a9772
			if(NOT (${FREERDP_SERVER_VENDOR} MATCHES "FreeRDP"))
Packit Service 5a9772
				list(APPEND FREERDP_EXTRA_SERVERS ${FREERDP_SERVER})
Packit Service 5a9772
			endif()
Packit Service 5a9772
		endif()
Packit Service 5a9772
	endif()
Packit Service 5a9772
endforeach()
Packit Service 5a9772
Packit Service 5a9772
foreach(FREERDP_SERVER ${FREERDP_EXTRA_SERVERS})
Packit Service 5a9772
	add_subdirectory(${FREERDP_SERVER})
Packit Service 5a9772
endforeach()
Packit Service 5a9772
Packit Service 5a9772
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-server.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc @ONLY)
Packit Service 5a9772
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
Packit Service 5a9772
Packit Service 5a9772
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
Packit Service 5a9772
Packit Service 5a9772
	export(PACKAGE freerdp-server)
Packit Service 5a9772
Packit Service 5a9772
	SetFreeRDPCMakeInstallDir(FREERDP_SERVER_CMAKE_INSTALL_DIR "FreeRDP-Server${FREERDP_VERSION_MAJOR}")
Packit Service 5a9772
Packit Service 5a9772
	configure_package_config_file(FreeRDP-ServerConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake
Packit Service 5a9772
		INSTALL_DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR}
Packit Service 5a9772
		PATH_VARS FREERDP_INCLUDE_DIR)
Packit Service 5a9772
Packit Service 5a9772
	write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake
Packit Service 5a9772
		VERSION ${FREERDP_VERSION} COMPATIBILITY SameMajorVersion)
Packit Service 5a9772
Packit Service 5a9772
	install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake
Packit Service 5a9772
		DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
Packit Service 5a9772
Packit Service 5a9772
	install(EXPORT FreeRDP-ServerTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
Packit Service 5a9772
Packit Service 5a9772
endif()