2016-01-18 17:55:33 +03:00
|
|
|
# UWAC: Using Wayland As Client
|
|
|
|
# cmake build script
|
|
|
|
#
|
|
|
|
# Copyright 2015 David FORT <contact@hardening-consulting.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.
|
|
|
|
|
2016-02-26 01:46:56 +03:00
|
|
|
# Soname versioning
|
|
|
|
set(UWAC_VERSION_MAJOR "0")
|
2021-03-02 11:30:58 +03:00
|
|
|
set(UWAC_VERSION_MINOR "2")
|
|
|
|
set(UWAC_VERSION_REVISION "0")
|
2016-02-26 01:46:56 +03:00
|
|
|
set(UWAC_VERSION "${UWAC_VERSION_MAJOR}.${UWAC_VERSION_MINOR}.${UWAC_VERSION_REVISION}")
|
|
|
|
set(UWAC_VERSION_FULL "${UWAC_VERSION}")
|
|
|
|
set(UWAC_API_VERSION "${UWAC_VERSION_MAJOR}")
|
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
if (NOT FREERDP_UNIFIED_BUILD)
|
2023-02-25 11:12:22 +03:00
|
|
|
cmake_minimum_required(VERSION 3.13)
|
2021-06-10 10:54:35 +03:00
|
|
|
project(uwac VERSION ${UWAC_VERSION} LANGUAGES C)
|
|
|
|
|
2022-05-25 16:14:36 +03:00
|
|
|
set(CMAKE_C_STANDARD 11)
|
2022-02-24 14:19:10 +03:00
|
|
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
|
|
|
set(CMAKE_C_EXTENSIONS ON)
|
|
|
|
|
2023-08-03 11:02:19 +03:00
|
|
|
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
|
2024-10-23 15:20:26 +03:00
|
|
|
option(BUILD_TESTING_INTERNAL "Build library unit tests" ON)
|
2016-02-26 01:47:32 +03:00
|
|
|
|
2023-08-03 11:02:19 +03:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCC)
|
|
|
|
if(NOT EXPORT_ALL_SYMBOLS)
|
|
|
|
message(STATUS "GCC default symbol visibility: hidden")
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
|
|
|
|
endif()
|
|
|
|
endif()
|
2021-06-10 10:54:35 +03:00
|
|
|
endif()
|
2016-02-26 01:47:32 +03:00
|
|
|
|
2023-12-21 12:28:10 +03:00
|
|
|
option(UWAC_FORCE_STATIC_BUILD "Force UWAC to be build as static libary (recommended)" OFF)
|
2023-01-10 16:47:16 +03:00
|
|
|
option(UWAC_HAVE_PIXMAN_REGION "Use PIXMAN or FreeRDP for region calculations" "NOT FREERDP_UNIFIED_BUILD")
|
2016-02-26 01:47:32 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
# Include our extra modules
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/)
|
2023-12-21 11:27:19 +03:00
|
|
|
include(CommonConfigOptions)
|
2016-02-26 01:47:32 +03:00
|
|
|
|
2024-09-28 14:41:46 +03:00
|
|
|
include(CheckFunctionExists)
|
|
|
|
check_function_exists(strerror_r UWAC_HAVE_STRERROR_R)
|
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
# Check for cmake compatibility (enable/disable features)
|
|
|
|
include(FindFeature)
|
2016-02-26 01:47:32 +03:00
|
|
|
|
2023-12-21 12:28:10 +03:00
|
|
|
if (UWAC_FORCE_STATIC_BUILD)
|
|
|
|
set(BUILD_SHARED_LIBS OFF)
|
|
|
|
else()
|
|
|
|
include(SetFreeRDPCMakeInstallDir)
|
|
|
|
include(CMakePackageConfigHelpers)
|
|
|
|
endif()
|
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
if (NOT IOS)
|
2021-06-22 10:11:06 +03:00
|
|
|
include(CheckIncludeFiles)
|
2023-08-03 11:02:19 +03:00
|
|
|
check_include_files(stdbool.h UWAC_HAVE_STDBOOL_H)
|
|
|
|
if (NOT UWAC_HAVE_STDBOOL_H)
|
2021-06-28 13:44:49 +03:00
|
|
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/../compat/stdbool)
|
2021-06-10 10:54:35 +03:00
|
|
|
endif()
|
|
|
|
endif()
|
2016-02-26 01:47:32 +03:00
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
# Find required libraries
|
2023-01-10 16:47:16 +03:00
|
|
|
if (UWAC_HAVE_PIXMAN_REGION)
|
2023-08-09 13:08:16 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2021-06-10 10:54:35 +03:00
|
|
|
pkg_check_modules(pixman REQUIRED pixman-1)
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${pixman_INCLUDE_DIRS})
|
2021-06-10 10:54:35 +03:00
|
|
|
elseif (FREERDP_UNIFIED_BUILD)
|
2021-06-21 12:39:34 +03:00
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/winpr/include)
|
|
|
|
include_directories(${PROJECT_BINARY_DIR}/winpr/include)
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
|
|
|
include_directories(${PROJECT_BINARY_DIR}/include)
|
2021-06-10 10:54:35 +03:00
|
|
|
else()
|
|
|
|
find_package(WinPR 3 REQUIRED)
|
|
|
|
find_package(FreeRDP 3 REQUIRED)
|
2024-08-26 12:01:54 +03:00
|
|
|
include_directories(SYSTEM ${WinPR_INCLUDE_DIR})
|
|
|
|
include_directories(SYSTEM ${FreeRDP_INCLUDE_DIR})
|
2016-02-26 01:47:32 +03:00
|
|
|
endif()
|
|
|
|
|
2021-06-10 10:54:35 +03:00
|
|
|
set(WAYLAND_FEATURE_PURPOSE "Wayland")
|
|
|
|
set(WAYLAND_FEATURE_DESCRIPTION "Wayland client")
|
|
|
|
set(WAYLAND_FEATURE_TYPE "REQUIRED")
|
|
|
|
find_feature(Wayland ${WAYLAND_FEATURE_TYPE} ${WAYLAND_FEATURE_PURPOSE} ${WAYLAND_FEATURE_DESCRIPTION})
|
|
|
|
|
2022-02-16 13:10:02 +03:00
|
|
|
set(UWAC_INCLUDE_DIR include/uwac${UWAC_API_VERSION})
|
|
|
|
|
|
|
|
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
|
|
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include)
|
2021-06-10 10:54:35 +03:00
|
|
|
|
|
|
|
add_subdirectory(libuwac)
|
|
|
|
add_subdirectory(templates)
|
2022-02-16 13:10:02 +03:00
|
|
|
add_subdirectory(include)
|
2021-06-10 10:54:35 +03:00
|
|
|
|