2012-10-09 06:48:17 +04:00
|
|
|
# FreeRDP: A Remote Desktop Protocol Implementation
|
2011-08-07 17:52:40 +04:00
|
|
|
# FreeRDP X11 Client
|
|
|
|
#
|
2012-10-01 19:48:53 +04:00
|
|
|
# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
|
2013-04-26 02:30:39 +04:00
|
|
|
# Copyright 2013 Corey Clayton <can.of.tuna@gmail.com>
|
2011-08-07 17:52:40 +04:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
2023-05-26 13:03:45 +03:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
project(xfreerdp-client LANGUAGES C)
|
|
|
|
|
|
|
|
set(CMAKE_C_STANDARD 11)
|
|
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_C_EXTENSIONS ON)
|
|
|
|
|
|
|
|
option(CMAKE_COLOR_MAKEFILE "colorful CMake makefile" ON)
|
|
|
|
option(CMAKE_VERBOSE_MAKEFILE "verbose CMake makefile" ON)
|
|
|
|
option(CMAKE_POSITION_INDEPENDENT_CODE "build with position independent code (-fPIC or -fPIE)" ON)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/)
|
|
|
|
|
|
|
|
include(ConfigureFreeRDP)
|
|
|
|
|
|
|
|
include(GNUInstallDirsWrapper)
|
|
|
|
|
|
|
|
# RPATH configuration
|
|
|
|
include(ConfigureRPATH)
|
|
|
|
|
|
|
|
find_package(X11 REQUIRED)
|
2012-10-01 19:48:53 +04:00
|
|
|
|
2013-08-06 17:02:36 +04:00
|
|
|
include(FindDocBookXSL)
|
2023-05-26 13:03:45 +03:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../resources)
|
2011-08-07 21:41:54 +04:00
|
|
|
include_directories(${X11_INCLUDE_DIRS})
|
2014-04-23 17:51:22 +04:00
|
|
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
set(SRCS
|
2023-03-01 18:01:08 +03:00
|
|
|
xf_utils.h
|
|
|
|
xf_utils.c
|
2011-08-26 02:07:52 +04:00
|
|
|
xf_gdi.c
|
|
|
|
xf_gdi.h
|
2014-06-05 02:03:25 +04:00
|
|
|
xf_gfx.c
|
|
|
|
xf_gfx.h
|
2011-08-16 08:22:00 +04:00
|
|
|
xf_rail.c
|
2023-02-21 11:40:09 +03:00
|
|
|
xf_rail.h
|
2013-04-26 02:57:41 +04:00
|
|
|
xf_input.c
|
|
|
|
xf_input.h
|
2011-08-07 17:52:40 +04:00
|
|
|
xf_event.c
|
|
|
|
xf_event.h
|
2018-09-18 22:25:51 +03:00
|
|
|
xf_floatbar.c
|
|
|
|
xf_floatbar.h
|
2013-05-09 05:51:16 +04:00
|
|
|
xf_input.c
|
|
|
|
xf_input.h
|
2013-05-14 03:17:25 +04:00
|
|
|
xf_channels.c
|
|
|
|
xf_channels.h
|
2011-10-21 01:28:59 +04:00
|
|
|
xf_cliprdr.c
|
2023-05-26 13:03:45 +03:00
|
|
|
xf_cliprdr.h
|
2011-08-31 04:59:42 +04:00
|
|
|
xf_monitor.c
|
|
|
|
xf_monitor.h
|
2017-11-29 12:26:04 +03:00
|
|
|
xf_disp.c
|
|
|
|
xf_disp.h
|
2011-10-21 01:28:59 +04:00
|
|
|
xf_graphics.c
|
|
|
|
xf_graphics.h
|
|
|
|
xf_keyboard.c
|
|
|
|
xf_keyboard.h
|
2017-12-15 13:15:24 +03:00
|
|
|
xf_video.c
|
|
|
|
xf_video.h
|
2011-08-09 06:24:12 +04:00
|
|
|
xf_window.c
|
|
|
|
xf_window.h
|
2013-06-15 21:41:05 +04:00
|
|
|
xf_client.c
|
|
|
|
xf_client.h)
|
2013-04-03 00:22:30 +04:00
|
|
|
|
2020-02-25 17:21:16 +03:00
|
|
|
if (CHANNEL_TSMF_CLIENT)
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND SRCS
|
|
|
|
xf_tsmf.c
|
|
|
|
xf_tsmf.h
|
|
|
|
)
|
2020-02-25 17:21:16 +03:00
|
|
|
endif()
|
|
|
|
|
2013-04-03 00:22:30 +04:00
|
|
|
if(WITH_CLIENT_INTERFACE)
|
2013-04-11 01:09:35 +04:00
|
|
|
if(CLIENT_INTERFACE_SHARED)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_library(${PROJECT_NAME} SHARED ${SRCS})
|
2016-05-03 11:44:42 +03:00
|
|
|
if (WITH_LIBRARY_VERSIONING)
|
2023-05-26 13:03:45 +03:00
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
|
2016-05-03 11:44:42 +03:00
|
|
|
endif()
|
2013-04-11 01:09:35 +04:00
|
|
|
else()
|
2023-05-26 13:03:45 +03:00
|
|
|
add_library(${PROJECT_NAME} ${SRCS})
|
2013-04-11 01:09:35 +04:00
|
|
|
endif()
|
2023-02-21 11:40:09 +03:00
|
|
|
|
2013-04-03 00:22:30 +04:00
|
|
|
else()
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND SRCS
|
|
|
|
cli/xfreerdp.c xfreerdp.h
|
|
|
|
)
|
|
|
|
add_executable(${PROJECT_NAME} ${SRCS})
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "xfreerdp")
|
2016-05-03 11:44:42 +03:00
|
|
|
include_directories(..)
|
2013-04-03 00:22:30 +04:00
|
|
|
endif()
|
2012-08-14 08:11:04 +04:00
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
set(LIBS
|
|
|
|
${X11_LIBRARIES}
|
|
|
|
)
|
2012-08-14 08:11:04 +04:00
|
|
|
|
2011-08-29 23:59:29 +04:00
|
|
|
if(WITH_MANPAGES)
|
2023-02-22 09:23:38 +03:00
|
|
|
find_program(XSLTPROC_EXECUTABLE NAMES xsltproc REQUIRED)
|
|
|
|
if (NOT DOCBOOKXSL_FOUND)
|
|
|
|
message(FATAL_ERROR "docbook xsl not found but required for manpage generation")
|
2013-08-15 21:25:29 +04:00
|
|
|
endif()
|
2023-02-22 09:23:38 +03:00
|
|
|
|
|
|
|
# We need the variable ${MAN_TODAY} to contain the current date in ISO
|
|
|
|
# format to replace it in the configure_file step.
|
|
|
|
include(today)
|
|
|
|
|
|
|
|
TODAY(MAN_TODAY)
|
|
|
|
|
|
|
|
configure_file(xfreerdp.1.xml.in xfreerdp.1.xml @ONLY IMMEDIATE)
|
|
|
|
|
|
|
|
# Compile the helper tool with default compiler settings.
|
|
|
|
# We need the include paths though.
|
|
|
|
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
|
|
|
|
set(GENERATE_INCLUDES "")
|
|
|
|
foreach(dir ${dirs})
|
|
|
|
set(GENERATE_INCLUDES ${GENERATE_INCLUDES} -I${dir})
|
|
|
|
endforeach(dir)
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT xfreerdp.1
|
|
|
|
COMMAND ${CMAKE_C_COMPILER} ${GENERATE_INCLUDES}
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/generate_argument_docbook.c
|
|
|
|
-o ${CMAKE_CURRENT_BINARY_DIR}/generate_argument_docbook
|
|
|
|
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/generate_argument_docbook
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-channels.1.xml ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-examples.1.xml ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-envvar.1.xml ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMAND ${XSLTPROC_EXECUTABLE} ${DOCBOOKXSL_DIR}/manpages/docbook.xsl xfreerdp.1.xml
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
DEPENDS
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1.xml
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-examples.1.xml
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-channels.1.xml
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/xfreerdp-envvar.1.xml)
|
|
|
|
|
|
|
|
add_custom_target(xfreerdp.manpage ALL
|
|
|
|
DEPENDS xfreerdp.1)
|
|
|
|
|
|
|
|
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/xfreerdp.1 1)
|
2011-08-30 22:24:28 +04:00
|
|
|
endif(WITH_MANPAGES)
|
2011-08-29 23:59:29 +04:00
|
|
|
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_XShm_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XSHM)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_XShm_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xext_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
2011-08-20 07:15:49 +04:00
|
|
|
endif()
|
2011-08-07 17:52:40 +04:00
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
|
|
|
|
option(WITH_XINERAMA "[X11] enable xinerama" ON)
|
|
|
|
if (WITH_XINERAMA)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xinerama_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XINERAMA)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_Xinerama_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xinerama_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
2011-08-24 06:58:36 +04:00
|
|
|
endif()
|
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
option(WITH_XEXT "[X11] enable Xext" ON)
|
|
|
|
if (WITH_XEXT)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xext_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XEXT)
|
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xext_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
2011-08-24 10:38:39 +04:00
|
|
|
endif()
|
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
option(WITH_XCURSOR "[X11] enalbe Xcursor" ON)
|
|
|
|
if (WITH_XCURSOR)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xcursor_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XCURSOR)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_Xcursor_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xcursor_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
option(WITH_XV "[X11] enable Xv" ON)
|
|
|
|
if (WITH_XV)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xv_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XV)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_Xv_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xv_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
2011-09-20 12:27:59 +04:00
|
|
|
endif()
|
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
option(WITH_XI "[X11] enalbe Xi" ON)
|
|
|
|
if (WITH_XI)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xi_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XI)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_Xi_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xi_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
2013-05-22 04:16:14 +04:00
|
|
|
endif()
|
2013-04-24 05:28:05 +04:00
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
option(WITH_XRENDER "[X11] enable XRender" ON)
|
2013-05-09 05:51:16 +04:00
|
|
|
if(WITH_XRENDER)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xrender_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XRENDER)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_Xrender_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xrender_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
2013-05-09 05:51:16 +04:00
|
|
|
endif()
|
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
option(WITH_XRANDR "[X11] enable XRandR" ON)
|
|
|
|
if (WITH_XRANDR)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xrandr_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XRANDR)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_Xrandr_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xrandr_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
2017-11-24 16:06:35 +03:00
|
|
|
endif()
|
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
option(WITH_XFIXES "[X11] enable Xfixes" ON)
|
|
|
|
if (WITH_XFIXES)
|
2023-05-31 09:29:24 +03:00
|
|
|
find_package(X11 REQUIRED)
|
|
|
|
if(X11_Xfixes_FOUND)
|
2023-05-26 13:03:45 +03:00
|
|
|
add_definitions(-DWITH_XFIXES)
|
2023-05-31 09:29:24 +03:00
|
|
|
include_directories(${X11_Xfixes_INCLUDE_PATH})
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
2023-05-31 09:29:24 +03:00
|
|
|
${X11_Xfixes_LIB}
|
2023-05-26 13:03:45 +03:00
|
|
|
)
|
|
|
|
endif()
|
2014-07-07 22:26:41 +04:00
|
|
|
endif()
|
|
|
|
|
2021-06-21 12:39:34 +03:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/resources)
|
2011-10-22 20:55:03 +04:00
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS
|
|
|
|
freerdp-client
|
|
|
|
freerdp
|
|
|
|
m
|
|
|
|
)
|
2016-04-07 15:39:16 +03:00
|
|
|
if (NOT APPLE)
|
2023-05-26 13:03:45 +03:00
|
|
|
list(APPEND LIBS rt)
|
2016-04-07 15:39:16 +03:00
|
|
|
endif()
|
2023-05-26 13:03:45 +03:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS})
|
2012-10-19 21:10:42 +04:00
|
|
|
|
2013-01-19 02:32:58 +04:00
|
|
|
if(WITH_IPP)
|
2023-05-26 13:03:45 +03:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${IPP_LIBRARY_LIST})
|
2013-01-19 02:32:58 +04:00
|
|
|
endif()
|
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
option(WITH_CLIENT_INTERFACE "Build clients as a library with an interface" OFF)
|
2013-04-03 00:22:30 +04:00
|
|
|
if(WITH_CLIENT_INTERFACE)
|
2023-05-26 13:03:45 +03:00
|
|
|
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
|
2013-04-03 00:22:30 +04:00
|
|
|
add_subdirectory(cli)
|
|
|
|
else()
|
2023-05-26 13:03:45 +03:00
|
|
|
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
|
2013-04-03 00:22:30 +04:00
|
|
|
endif()
|
2012-10-01 19:48:53 +04:00
|
|
|
|
2023-05-26 13:03:45 +03:00
|
|
|
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/X11")
|
2013-04-03 00:22:30 +04:00
|
|
|
|