2022-12-30 13:25:28 +03:00
|
|
|
# FreeRDP: A Remote Desktop Protocol Implementation
|
|
|
|
# FreeRDP SDL Client
|
|
|
|
#
|
|
|
|
# Copyright 2022 Armin Novak <anovak@thincast.com>
|
|
|
|
#
|
|
|
|
# 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-03-06 18:04:05 +03:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
|
|
|
|
|
|
|
project(sdl-client CXX)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_CXX_EXTENSIONS ON)
|
|
|
|
|
2023-05-23 09:24:41 +03:00
|
|
|
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)
|
2023-05-25 16:25:06 +03:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/)
|
|
|
|
|
|
|
|
include(ConfigureFreeRDP)
|
2023-03-06 18:04:05 +03:00
|
|
|
|
|
|
|
include(GNUInstallDirsWrapper)
|
2023-05-25 16:25:06 +03:00
|
|
|
|
2023-03-06 18:04:05 +03:00
|
|
|
# RPATH configuration
|
2023-05-25 16:25:06 +03:00
|
|
|
include(ConfigureRPATH)
|
2022-12-30 13:25:28 +03:00
|
|
|
|
2023-02-14 16:35:53 +03:00
|
|
|
option(WITH_DEBUG_SDL_EVENTS "[dangerous, not for release builds!] Debug SDL events" OFF)
|
|
|
|
option(WITH_DEBUG_SDL_KBD_EVENTS "[dangerous, not for release builds!] Debug SDL keyboard events" OFF)
|
2023-07-19 17:43:28 +03:00
|
|
|
option(WITH_WIN_CONSOLE "Build ${PROJECT_NAME} with console support" ON)
|
|
|
|
|
|
|
|
if(WITH_WIN_CONSOLE)
|
|
|
|
set(WIN32_GUI_FLAG "")
|
|
|
|
else()
|
|
|
|
set(WIN32_GUI_FLAG "WIN32")
|
|
|
|
endif()
|
|
|
|
|
2023-02-14 16:35:53 +03:00
|
|
|
|
|
|
|
if (WITH_DEBUG_SDL_EVENTS)
|
|
|
|
add_definitions(-DWITH_DEBUG_SDL_EVENTS)
|
|
|
|
endif()
|
|
|
|
if (WITH_DEBUG_SDL_KBD_EVENTS)
|
|
|
|
add_definitions(-DWITH_DEBUG_SDL_KBD_EVENTS)
|
|
|
|
endif()
|
|
|
|
|
2023-02-14 18:16:24 +03:00
|
|
|
find_package(SDL2 REQUIRED COMPONENTS)
|
2023-03-06 18:04:05 +03:00
|
|
|
include_directories(${SDL2_INCLUDE_DIR})
|
2022-12-30 13:25:28 +03:00
|
|
|
include_directories(${SDL2_INCLUDE_DIRS})
|
2023-03-06 18:04:05 +03:00
|
|
|
|
2023-05-30 21:38:15 +03:00
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
|
2023-02-14 18:16:24 +03:00
|
|
|
add_subdirectory(dialogs)
|
2022-12-30 13:25:28 +03:00
|
|
|
set(SRCS
|
2023-04-14 10:16:50 +03:00
|
|
|
sdl_types.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_utils.cpp
|
2023-04-14 09:36:05 +03:00
|
|
|
sdl_utils.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_kbd.cpp
|
2023-04-14 09:36:05 +03:00
|
|
|
sdl_kbd.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_touch.cpp
|
2023-04-14 09:36:05 +03:00
|
|
|
sdl_touch.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_pointer.cpp
|
2023-04-14 09:36:05 +03:00
|
|
|
sdl_pointer.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_disp.cpp
|
2023-04-14 09:36:05 +03:00
|
|
|
sdl_disp.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_monitor.cpp
|
2023-04-14 09:36:05 +03:00
|
|
|
sdl_monitor.hpp
|
|
|
|
sdl_freerdp.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_freerdp.cpp
|
2023-04-14 09:36:05 +03:00
|
|
|
sdl_channels.hpp
|
2023-03-06 18:04:05 +03:00
|
|
|
sdl_channels.cpp)
|
2022-12-30 13:25:28 +03:00
|
|
|
|
|
|
|
set(LIBS
|
|
|
|
${SDL2_LIBRARIES}
|
2023-03-06 18:04:05 +03:00
|
|
|
winpr
|
|
|
|
freerdp
|
|
|
|
freerdp-client
|
2023-05-30 21:38:15 +03:00
|
|
|
Threads::Threads
|
2023-02-14 18:16:24 +03:00
|
|
|
dialogs
|
2023-03-06 18:04:05 +03:00
|
|
|
)
|
|
|
|
|
2023-05-17 20:25:37 +03:00
|
|
|
option(WITH_WEBVIEW "Build with QtWebEngine support for AAD login popup browser" OFF)
|
|
|
|
if (WITH_WEBVIEW)
|
2023-05-23 06:48:28 +03:00
|
|
|
find_package(Qt5 COMPONENTS WebEngineWidgets REQUIRED)
|
2023-05-17 20:25:37 +03:00
|
|
|
|
2023-05-23 06:48:28 +03:00
|
|
|
list(APPEND SRCS
|
|
|
|
sdl_webview.cpp
|
|
|
|
sdl_webview.hpp
|
|
|
|
)
|
|
|
|
list(APPEND LIBS Qt5::WebEngineWidgets)
|
2023-05-17 20:25:37 +03:00
|
|
|
endif()
|
|
|
|
|
2023-03-06 18:04:05 +03:00
|
|
|
add_executable(${PROJECT_NAME}
|
2023-07-19 17:43:28 +03:00
|
|
|
${WIN32_GUI_FLAG}
|
2023-03-06 18:04:05 +03:00
|
|
|
${SRCS}
|
|
|
|
)
|
2022-12-30 13:25:28 +03:00
|
|
|
|
2023-05-23 06:48:28 +03:00
|
|
|
if (WITH_WEBVIEW)
|
|
|
|
target_compile_definitions(
|
|
|
|
${PROJECT_NAME} PRIVATE
|
|
|
|
-DWITH_WEBVIEW
|
|
|
|
)
|
2023-05-17 20:25:37 +03:00
|
|
|
endif()
|
|
|
|
|
2023-05-23 06:48:28 +03:00
|
|
|
set_target_properties(${PROJECT_NAME}
|
|
|
|
PROPERTIES
|
|
|
|
OUTPUT_NAME "sdl-freerdp"
|
|
|
|
)
|
2023-03-06 18:04:05 +03:00
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE ${LIBS})
|
|
|
|
set_property(TARGET ${PROJECT_NAME} PROPERTY FOLDER "Client/SDL")
|
|
|
|
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT client)
|