FreeRDP/client/X11/CMakeLists.txt

228 lines
4.9 KiB
CMake
Raw Normal View History

# FreeRDP: A Remote Desktop Protocol Implementation
2011-08-07 17:52:40 +04:00
# FreeRDP X11 Client
#
# 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.
cmake_minimum_required(VERSION 3.13)
2011-08-07 17:52:40 +04:00
if (NOT FREERDP_DEFAULT_PROJECT_VERSION)
set(FREERDP_DEFAULT_PROJECT_VERSION "1.0.0.0")
endif()
project(xfreerdp-client
LANGUAGES C
VERSION ${FREERDP_DEFAULT_PROJECT_VERSION}
)
message("project ${PROJECT_NAME} is using version ${PROJECT_VERSION}")
set(MODULE_NAME "xfreerdp")
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS ON)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/)
2023-12-21 11:27:19 +03:00
include(CommonConfigOptions)
include(ConfigureFreeRDP)
find_package(X11 REQUIRED)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../resources)
include_directories(${X11_INCLUDE_DIRS})
include_directories(${OPENSSL_INCLUDE_DIR})
2011-08-07 17:52:40 +04:00
set(SRCS
xf_utils.h
xf_utils.c
xf_gfx.c
xf_gfx.h
xf_rail.c
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
xf_input.c
xf_input.h
xf_channels.c
xf_channels.h
xf_cliprdr.c
xf_cliprdr.h
xf_monitor.c
xf_monitor.h
xf_disp.c
xf_disp.h
xf_graphics.c
xf_graphics.h
xf_keyboard.c
xf_keyboard.h
xf_video.c
xf_video.h
2011-08-09 06:24:12 +04:00
xf_window.c
xf_window.h
xf_client.c
xf_client.h)
if (CHANNEL_TSMF_CLIENT)
list(APPEND SRCS
xf_tsmf.c
xf_tsmf.h
)
endif()
if(CLIENT_INTERFACE_SHARED)
AddTargetWithResourceFile(${PROJECT_NAME} "SHARED" "${PROJECT_VERSION}" SRCS)
else()
AddTargetWithResourceFile(${PROJECT_NAME} "STATIC" "${PROJECT_VERSION}" SRCS)
endif()
target_include_directories(${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
2024-04-03 10:21:39 +03:00
set(PRIV_LIBS
${X11_LIBRARIES}
)
2023-05-31 09:29:24 +03:00
find_package(X11 REQUIRED)
if(X11_XShm_FOUND)
add_definitions(-DWITH_XSHM)
2023-05-31 09:29:24 +03:00
include_directories(${X11_XShm_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xext_LIB}
)
endif()
2011-08-07 17:52:40 +04: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)
add_definitions(-DWITH_XINERAMA)
2023-05-31 09:29:24 +03:00
include_directories(${X11_Xinerama_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xinerama_LIB}
)
endif()
endif()
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)
add_definitions(-DWITH_XEXT)
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xext_LIB}
)
endif()
endif()
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)
add_definitions(-DWITH_XCURSOR)
2023-05-31 09:29:24 +03:00
include_directories(${X11_Xcursor_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xcursor_LIB}
)
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)
add_definitions(-DWITH_XV)
2023-05-31 09:29:24 +03:00
include_directories(${X11_Xv_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xv_LIB}
)
endif()
2011-09-20 12:27:59 +04:00
endif()
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)
add_definitions(-DWITH_XI)
2023-05-31 09:29:24 +03:00
include_directories(${X11_Xi_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xi_LIB}
)
endif()
2013-05-22 04:16:14 +04:00
endif()
2013-04-24 05:28:05 +04:00
option(WITH_XRENDER "[X11] enable XRender" ON)
if(WITH_XRENDER)
2023-05-31 09:29:24 +03:00
find_package(X11 REQUIRED)
if(X11_Xrender_FOUND)
add_definitions(-DWITH_XRENDER)
2023-05-31 09:29:24 +03:00
include_directories(${X11_Xrender_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xrender_LIB}
)
endif()
endif()
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)
add_definitions(-DWITH_XRANDR)
2023-05-31 09:29:24 +03:00
include_directories(${X11_Xrandr_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xrandr_LIB}
)
endif()
endif()
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)
add_definitions(-DWITH_XFIXES)
2023-05-31 09:29:24 +03:00
include_directories(${X11_Xfixes_INCLUDE_PATH})
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS
2023-05-31 09:29:24 +03:00
${X11_Xfixes_LIB}
)
endif()
endif()
include_directories(${PROJECT_SOURCE_DIR}/resources)
2011-10-22 20:55:03 +04:00
2024-04-03 10:21:39 +03:00
list(APPEND PUB_LIBS
freerdp-client
2024-04-03 10:21:39 +03:00
)
list(APPEND PRIV_LIBS
m
)
if (NOT APPLE)
2024-04-03 10:21:39 +03:00
list(APPEND PRIV_LIBS rt)
endif()
2024-04-03 10:21:39 +03:00
target_link_libraries(${PROJECT_NAME} PUBLIC ${PUB_LIBS})
target_link_libraries(${PROJECT_NAME} PRIVATE ${PRIV_LIBS})
if(WITH_CLIENT_INTERFACE)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT libraries)
endif()
add_subdirectory(cli)
add_subdirectory(man)
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/X11")