Fixed rdtk, uwac and winpr standalone builds

This commit is contained in:
akallabeth 2021-06-10 09:54:35 +02:00 committed by akallabeth
parent 81cef9251f
commit b453d5e40e
57 changed files with 835 additions and 526 deletions

View File

@ -2,8 +2,6 @@
# Generate .txt license file for CPack (PackageMaker requires a file extension)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt @ONLY)
SET(CPACK_BINARY_ZIP "ON")
# Workaround to remove c++ compiler macros and defines for Eclipse.
# If c++ macros/defines are set __cplusplus is also set which causes
# problems when compiling freerdp/jni. To prevent this problem we set the macros to "".

View File

@ -20,7 +20,7 @@
cmake_minimum_required(VERSION 3.4)
project(FreeRDP C CXX)
project(FreeRDP C)
if(NOT DEFINED VENDOR)
set(VENDOR "FreeRDP" CACHE STRING "FreeRDP package vendor")
@ -67,7 +67,6 @@ include(ConfigOptions)
include(ComplexLibrary)
include(FeatureSummary)
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
include(GNUInstallDirsWrapper)
include(CMakePackageConfigHelpers)
include(InstallFreeRDPMan)
@ -130,17 +129,9 @@ endif(CMAKE_CROSSCOMPILING)
find_program(CCACHE ccache)
if(CCACHE AND WITH_CCACHE)
if(CMAKE_VERSION VERSION_GREATER 3.3.2)
if(NOT DEFINED CMAKE_C_COMPILER_LAUNCHER)
SET(CMAKE_C_COMPILER_LAUNCHER ${CCACHE})
endif(NOT DEFINED CMAKE_C_COMPILER_LAUNCHER)
if(NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
SET(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE})
endif(NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
else()
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE})
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE})
endif()
endif(CCACHE AND WITH_CCACHE)
if(EXISTS "${CMAKE_SOURCE_DIR}/.source_version" )
@ -170,13 +161,12 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
if(NOT DEFINED BUILD_SHARED_LIBS)
set(LIB_DEFAULT ON)
if (IOS)
set(BUILD_SHARED_LIBS OFF)
else()
set(BUILD_SHARED_LIBS ON)
endif()
set(LIB_DEFAULT OFF)
endif()
option(BUILD_SHARED_LIBS "Build shared libraries" ${LIB_DEFAULT})
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
if(BUILD_TESTING)
set(EXPORT_ALL_SYMBOLS TRUE)
@ -254,12 +244,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -march=i686")
endif()
else()
if(CMAKE_POSITION_INDEPENDENT_CODE)
if(${CMAKE_VERSION} VERSION_LESS 2.8.9)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
@ -276,10 +260,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
if(Wno-deprecated-declarations)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif()
CHECK_CXX_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarationsCXX)
if(Wno-deprecated-declarationsCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
if(NOT EXPORT_ALL_SYMBOLS)
message(STATUS "GCC default symbol visibility: hidden")
@ -306,7 +286,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
add_definitions(-DNDEBUG)
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
endif()
endif()
@ -319,11 +298,6 @@ if (CMAKE_GENERATOR MATCHES "Unix Makefile*")
if(Wno-builtin-macro-redefined)
set(CMAKE_C_FLAGS_${UPPER_BUILD_TYPE} "${CMAKE_C_FLAGS_${UPPER_BUILD_TYPE}} -Wno-builtin-macro-redefined -D__FILE__='\"$(subst ${CMAKE_BINARY_DIR}/,,$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<)))\"'")
endif()
CHECK_CXX_COMPILER_FLAG (-Wno-builtin-macro-redefined Wno-builtin-macro-redefinedCXX)
if(Wno-builtin-macro-redefinedCXX)
set(CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE}} -Wno-builtin-macro-redefined -D__FILE__='\"$(subst ${CMAKE_BINARY_DIR}/,,$(subst ${CMAKE_SOURCE_DIR}/,,$(abspath $<)))\"'")
endif()
endif()
endif()
@ -336,10 +310,6 @@ if(${CMAKE_C_COMPILER_ID} STREQUAL "Clang")
if(Wno-deprecated-declarations)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif()
CHECK_CXX_COMPILER_FLAG(-Wno-deprecated-declarations Wno-deprecated-declarationsCXX)
if(Wno-deprecated-declarationsCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
endif()
set(THREAD_PREFER_PTHREAD_FLAG TRUE)
@ -440,10 +410,6 @@ if(MSVC)
# NMake is otherwise complaining.
foreach (flags_var_to_scrub
CMAKE_C_FLAGS
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_MINSIZEREL)
@ -460,7 +426,6 @@ if(MSVC)
if(CMAKE_BUILD_TYPE STREQUAL "Release")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Zi")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zi")
endif()
endif()
@ -468,9 +433,7 @@ endif()
if(ANDROID)
# workaround for https://github.com/android-ndk/ndk/issues/243
string(REPLACE "-g " "" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
string(REPLACE "-g " "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
endif()
if(WIN32)
@ -515,7 +478,7 @@ if(WIN32)
endif()
endif()
add_definitions(-DWINPR_EXPORTS -DFREERDP_EXPORTS)
add_definitions(-DFREERDP_EXPORTS)
# Include files
if(NOT IOS)
@ -564,7 +527,6 @@ if(APPLE)
if (WITH_VERBOSE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -v")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v")
endif()
endif(APPLE)
@ -1017,22 +979,21 @@ if(BUILD_TESTING)
endif()
# WinPR
include_directories("${CMAKE_SOURCE_DIR}/winpr/include")
include_directories("${CMAKE_BINARY_DIR}/winpr/include")
if (${CMAKE_VERSION} VERSION_LESS 2.8.12)
set(PUBLIC_KEYWORD "")
set(PRIVATE_KEYWORD "")
else()
set(PUBLIC_KEYWORD "PUBLIC")
set(PRIVATE_KEYWORD "PRIVATE")
endif()
if(BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_DLL")
endif()
if (FREERDP_UNIFIED_BUILD)
add_subdirectory(winpr)
if (WITH_WAYLAND)
add_subdirectory(uwac)
endif()
if (WITH_SERVER)
add_subdirectory(rdtk)
endif()
include_directories(${CMAKE_SOURCE_DIR}/winpr/include)
include_directories(${CMAKE_BINARY_DIR}/winpr/include)
else()
find_package(WinPR 3 REQUIRED)
include_directories(${WinPR_INCLUDE_DIR})
endif()
# Sub-directories
@ -1047,16 +1008,6 @@ add_subdirectory(include)
add_subdirectory(libfreerdp)
# RdTk
include_directories("${CMAKE_SOURCE_DIR}/rdtk/include")
include_directories("${CMAKE_BINARY_DIR}/rdtk/include")
add_subdirectory(rdtk)
if(WAYLAND_FOUND)
add_subdirectory(uwac)
endif()
if(BSD)
if(IS_DIRECTORY /usr/local/include)
include_directories(/usr/local/include)

View File

@ -209,7 +209,7 @@ macro(add_channel_client_library _module_prefix _module_name _channel_name _dyna
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS)
if (NOT BUILTIN_CHANNELS)
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endif()
@ -249,7 +249,7 @@ macro(add_channel_client_subsystem_library _module_prefix _module_name _channel_
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
target_link_libraries(${_module_name} ${${_module_prefix}_LIBS})
if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS)
if (NOT BUILTIN_CHANNELS)
client_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endif()
@ -268,7 +268,7 @@ macro(add_channel_server_library _module_prefix _module_name _channel_name _dyna
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${_module_name}${FREERDP_VERSION_MAJOR}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
@ -286,7 +286,7 @@ macro(add_channel_server_library _module_prefix _module_name _channel_name _dyna
set(${_module_prefix}_CHANNEL ${_channel_name} PARENT_SCOPE)
set(${_module_prefix}_ENTRY ${_entry} PARENT_SCOPE)
add_library(${_module_name} STATIC ${${_module_prefix}_SRCS})
if (${CMAKE_VERSION} VERSION_LESS 2.8.12 OR NOT BUILD_SHARED_LIBS)
if (NOT BUILTIN_CHANNELS)
server_channel_install(${_module_name} ${FREERDP_ADDIN_PATH})
endif()
endif()

View File

@ -81,7 +81,6 @@ endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-client.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-client${FREERDP_VERSION_MAJOR}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-client${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
export(PACKAGE freerdp-client)
@ -97,6 +96,6 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ClientConfigVersion.cmake
DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR})
if (NOT BUILTIN_CHANNELS)
install(EXPORT FreeRDP-ClientTargets DESTINATION ${FREERDP_CLIENT_CMAKE_INSTALL_DIR})
endif()

View File

@ -2,10 +2,8 @@
project(MacFreeRDP-library)
if(${CMAKE_VERSION} GREATER 2.8.12)
cmake_policy(SET CMP0026 OLD)
cmake_policy(SET CMP0045 OLD)
endif()
set(MODULE_NAME "MacFreeRDP-library")
set(MODULE_OUTPUT_NAME "MacFreeRDP")

View File

@ -20,7 +20,6 @@ set(MODULE_NAME "wlfreerdp")
set(MODULE_PREFIX "FREERDP_CLIENT_WAYLAND")
include_directories(${WAYLAND_INCLUDE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/uwac/include)
set(${MODULE_PREFIX}_SRCS
wlfreerdp.c
@ -37,6 +36,14 @@ set(${MODULE_PREFIX}_SRCS
wlf_channels.h
)
if (FREERDP_UNIFIED_BUILD)
include_directories(${CMAKE_SOURCE_DIR}/uwac/include)
include_directories(${CMAKE_BINARY_DIR}/uwac/include)
else()
find_package(uwac 0 REQUIRED)
include_directories(${UWAC_INCLUDE_DIR})
endif()
list (APPEND ${MODULE_PREFIX}_LIBS freerdp-client freerdp uwac)
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})

View File

@ -45,7 +45,7 @@ if (WIN32 AND BUILD_SHARED_LIBS)
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
if(WITH_CLIENT_INTERFACE)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
else()
set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" )
endif()
@ -60,6 +60,7 @@ endif()
if(WITH_CLIENT_INTERFACE)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
if(CLIENT_INTERFACE_SHARED)
add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
else()

View File

@ -221,8 +221,8 @@ endif()
if(WITH_XRANDR)
add_definitions(-DWITH_XRANDR)
include_directories(${XRANDR_INCLUDE_DIRS})
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${XRANDR_LIBRARIES})
include_directories(${XRandR_INCLUDE_DIRS})
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} ${XRandR_LIBRARIES})
endif()
if(WITH_XFIXES)
@ -245,10 +245,10 @@ set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-client freerdp m)
if (NOT APPLE)
list(APPEND ${MODULE_PREFIX}_LIBS rt)
endif()
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS})
target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS})
if(WITH_IPP)
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${IPP_LIBRARY_LIST})
target_link_libraries(${MODULE_NAME} PRIVATE ${IPP_LIBRARY_LIST})
endif()
if(WITH_CLIENT_INTERFACE)

View File

@ -46,7 +46,7 @@ if (WIN32 AND BUILD_SHARED_LIBS)
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
@ -66,11 +66,11 @@ endif()
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} winpr)
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${FREERDP_CHANNELS_CLIENT_LIBS})
target_link_libraries(${MODULE_NAME} PRIVATE ${FREERDP_CHANNELS_CLIENT_LIBS})
if(OPENBSD)
target_link_libraries(${MODULE_NAME} ${PUBLIC_KEYWORD} ${${MODULE_PREFIX}_LIBS} sndio)
target_link_libraries(${MODULE_NAME} PUBLIC ${${MODULE_PREFIX}_LIBS} sndio)
else()
target_link_libraries(${MODULE_NAME} ${PUBLIC_KEYWORD} ${${MODULE_PREFIX}_LIBS})
target_link_libraries(${MODULE_NAME} PUBLIC ${${MODULE_PREFIX}_LIBS})
endif()

View File

@ -24,19 +24,3 @@ endmacro()
# Compatibility includes - order does matter!
enable_cmake_compat(3.7.0)
enable_cmake_compat(2.8.11)
enable_cmake_compat(2.8.6)
enable_cmake_compat(2.8.3)
enable_cmake_compat(2.8.2)
# GetGitRevisionDescription requires FindGit which was added in version 2.8.2
# build won't fail but GIT_REVISION is set to n/a
if(${CMAKE_VERSION} VERSION_LESS 2.8.2)
message(WARNING "GetGitRevisionDescription reqires (FindGit) cmake >= 2.8.2 to work properly - GIT_REVISION will be set to n/a")
endif()
# Since cmake 2.8.9 modules/library names without lib/.so can be used
# for dependencies
if(IOS AND ${CMAKE_VERSION} VERSION_LESS 2.8.9)
message(FATAL_ERROR "CMAKE version >= 2.8.9 required to build the IOS client")
endif()

View File

@ -64,10 +64,6 @@ macro(add_complex_library)
endmacro(add_complex_library)
if(${CMAKE_VERSION} VERSION_GREATER 2.8.8)
set(CMAKE_OBJECT_TARGET_SUPPORT 1)
endif()
function(create_object_cotarget target)
set(cotarget "${target}-objects")

View File

@ -79,7 +79,7 @@ option(BUILTIN_CHANNELS "Combine all channels into their respective base library
option(WITH_CHANNELS "Build virtual channel plugins" ON)
option(WITH_WINPR_TOOLS "Build WinPR helper binaries" ON)
option(FREERDP_UNIFIED_BUILD "Build WinPR, uwac, RdTk and FreeRDP in one go" ON)
CMAKE_DEPENDENT_OPTION(WITH_CLIENT_CHANNELS "Build virtual channel plugins" ON
"WITH_CLIENT_COMMON;WITH_CHANNELS" OFF)

View File

@ -1,13 +1,13 @@
# - Find XRANDR
# Find the XRANDR libraries
# - Find XRandR
# Find the XRandR libraries
#
# This module defines the following variables:
# XRANDR_FOUND - true if XRANDR_INCLUDE_DIR & XRANDR_LIBRARY are found
# XRANDR_LIBRARIES - Set when XRANDR_LIBRARY is found
# XRANDR_INCLUDE_DIRS - Set when XRANDR_INCLUDE_DIR is found
# XRandR_FOUND - true if XRANDR_INCLUDE_DIR & XRANDR_LIBRARY are found
# XRandR_LIBRARIES - Set when XRANDR_LIBRARY is found
# XRandR_INCLUDE_DIRS - Set when XRANDR_INCLUDE_DIR is found
#
# XRANDR_INCLUDE_DIR - where to find Xrandr.h, etc.
# XRANDR_LIBRARY - the XRANDR library
# XRandR_INCLUDE_DIR - where to find Xrandr.h, etc.
# XRandR_LIBRARY - the XRANDR library
#
#=============================================================================
@ -26,24 +26,24 @@
# limitations under the License.
#=============================================================================
find_path(XRANDR_INCLUDE_DIR NAMES X11/extensions/Xrandr.h
find_path(XRandR_INCLUDE_DIR NAMES X11/extensions/Xrandr.h
PATH_SUFFIXES X11/extensions
PATHS /opt/X11/include
DOC "The XRANDR include directory"
DOC "The XRandR include directory"
)
find_library(XRANDR_LIBRARY NAMES Xrandr
find_library(XRandR_LIBRARY NAMES Xrandr
PATHS /opt/X11/lib
DOC "The XRANDR library"
DOC "The XRandR library"
)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XRANDR DEFAULT_MSG XRANDR_LIBRARY XRANDR_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(XRandR DEFAULT_MSG XRandR_LIBRARY XRandR_INCLUDE_DIR)
if(XRANDR_FOUND)
set( XRANDR_LIBRARIES ${XRANDR_LIBRARY} )
set( XRANDR_INCLUDE_DIRS ${XRANDR_INCLUDE_DIR} )
if(XRandR_FOUND)
set( XRandR_LIBRARIES ${XRandR_LIBRARY} )
set( XRandR_INCLUDE_DIRS ${XRandR_INCLUDE_DIR} )
endif()
mark_as_advanced(XRANDR_INCLUDE_DIR XRANDR_LIBRARY)
mark_as_advanced(XRandR_INCLUDE_DIR XRandR_LIBRARY)

View File

@ -6,14 +6,6 @@ MACRO (TODAY RESULT)
if (DEFINED ENV{SOURCE_DATE_EPOCH} AND NOT WIN32)
EXECUTE_PROCESS(COMMAND "date" "-u" "-d" "@$ENV{SOURCE_DATE_EPOCH}" "+%Y-%m-%d"
OUTPUT_VARIABLE ${RESULT} OUTPUT_STRIP_TRAILING_WHITESPACE)
elseif(CMAKE_VERSION VERSION_LESS "2.8.11")
if (WIN32)
message(FATAL_ERROR "Your CMake version is too old. Please update to a more recent version >= 2.8.11")
else()
EXECUTE_PROCESS(COMMAND "date" "-u" "+%Y-%m-%d"
OUTPUT_VARIABLE ${RESULT} OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
else()
STRING(TIMESTAMP ${RESULT} "%Y-%m-%d" UTC)
endif()
ENDMACRO (TODAY)

View File

@ -366,7 +366,7 @@ if (WIN32)
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
@ -387,7 +387,7 @@ if (WITH_LIBRARY_VERSIONING)
endif()
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${LIBFREERDP_LIBS} winpr)
target_link_libraries(${MODULE_NAME} PRIVATE ${LIBFREERDP_LIBS} winpr)
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDPTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@ -405,8 +405,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp.pc.in ${CMAKE_CURRENT_BINARY_
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
## cmake project
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
export(PACKAGE freerdp)
SetFreeRDPCMakeInstallDir(FREERDP_CMAKE_INSTALL_DIR "FreeRDP${FREERDP_VERSION_MAJOR}")
@ -422,5 +420,3 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
DESTINATION ${FREERDP_CMAKE_INSTALL_DIR})
install(EXPORT FreeRDPTargets DESTINATION ${FREERDP_CMAKE_INSTALL_DIR})
endif()

View File

@ -309,6 +309,7 @@ static BOOL autodetect_send_bandwidth_measure_results(rdpRdp* rdp, UINT16 respon
"sending Bandwidth Measure Results PDU -> timeDelta=%" PRIu64 ", byteCount=%" PRIu32
"",
timeDelta, rdp->autodetect->bandwidthMeasureByteCount);
Stream_Write_UINT8(s, 0x0E); /* headerLength (1 byte) */
Stream_Write_UINT8(s, TYPE_ID_AUTODETECT_RESPONSE); /* headerTypeId (1 byte) */
Stream_Write_UINT16(s, sequenceNumber); /* sequenceNumber (2 bytes) */

View File

@ -78,6 +78,7 @@ BOOL ntlm_client_init(rdpNtlm* ntlm, BOOL http, LPCSTR user, LPCSTR domain, LPCS
SecPkgContext_Bindings* Bindings)
{
SECURITY_STATUS status;
ntlm->http = http;
ntlm->Bindings = Bindings;
ntlm->table = InitSecurityInterfaceEx(0);

View File

@ -15,12 +15,41 @@
# See the License for the specific language governing permissions and
# limitations under the License.
cmake_minimum_required(VERSION 2.8)
# Soname versioning
set(RDTK_VERSION_MAJOR "0")
set(RDTK_VERSION_MINOR "2")
set(RDTK_VERSION_REVISION "0")
set(RDTK_VERSION "${RDTK_VERSION_MAJOR}.${RDTK_VERSION_MINOR}.${RDTK_VERSION_REVISION}")
set(RDTK_VERSION_FULL "${RDTK_VERSION}")
set(RDTK_API_VERSION "${RDTK_VERSION_MAJOR}")
project(RdTk C)
if (NOT FREERDP_UNIFIED_BUILD)
cmake_minimum_required(VERSION 3.4)
project(RdTk VERSION ${RDTK_VERSION} LANGUAGES C)
set(CMAKE_COLOR_MAKEFILE ON)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
option(BUILD_TESTING "Build library unit tests" ON)
option(WITH_LIBRARY_VERSIONING "Use library version triplet" ON)
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
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()
endif()
# Include our extra modules
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/)
# Include cmake modules
include(CheckIncludeFiles)
include(CheckLibraryExists)
@ -28,25 +57,16 @@ include(CheckStructHasMember)
include(FindPkgConfig)
include(TestBigEndian)
# Include our extra modules
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/)
# Check for cmake compatibility (enable/disable features)
include(CheckCmakeCompat)
include(FindFeature)
include(ConfigOptions)
include(CheckCCompilerFlag)
include(GNUInstallDirsWrapper)
include(CMakePackageConfigHelpers)
include (SetFreeRDPCMakeInstallDir)
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
# Default to build shared libs
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
if(BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DRDTK_EXPORTS")
endif()
if (NOT IOS)
@ -58,15 +78,26 @@ else()
set(WINPR_HAVE_STDBOOL_H 1)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DRDTK_EXPORTS")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
if (FREERDP_UNIFIED_BUILD)
include_directories(${CMAKE_SOURCE_DIR}/winpr/include)
include_directories(${CMAKE_BINARY_DIR}/winpr/include)
else()
find_package(WinPR 3 REQUIRED)
include_directories(${WinPR_INCLUDE_DIR})
endif()
SetFreeRDPCMakeInstallDir(RDTK_CMAKE_INSTALL_DIR "rdtk${RDTK_VERSION_MAJOR}")
add_subdirectory(include)
add_subdirectory(librdtk)
add_subdirectory(templates)
install(EXPORT rdtk DESTINATION ${RDTK_CMAKE_INSTALL_DIR})
if(WITH_SAMPLE)
if(WITH_X11)
add_subdirectory(sample)
endif()
endif()

View File

@ -0,0 +1,2 @@
file(GLOB RDTK_HEADERS "rdkt/*.h")
install(FILES ${RDTK_HEADERS} DESTINATION include/rdkt${RDTK_API_VERSION}/rdkt COMPONENT headers)

View File

@ -21,8 +21,6 @@
#include <winpr/spec.h>
/* Don't do any export */
#if 0
#if defined _WIN32 || defined __CYGWIN__
#ifdef RDTK_EXPORTS
#ifdef __GNUC__
@ -44,7 +42,5 @@
#define RDTK_EXPORT
#endif
#endif
#endif
#define RDTK_EXPORT
#endif /* RDTK_API_H */

View File

@ -36,12 +36,33 @@ set(${MODULE_PREFIX}_SRCS
rdtk_engine.c
rdtk_engine.h)
add_library(${MODULE_NAME} STATIC ${${MODULE_PREFIX}_SRCS})
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
set (RC_VERSION_MAJOR ${RDTK_VERSION_MAJOR})
set (RC_VERSION_MINOR ${RDTK_VERSION_MINOR})
set (RC_VERSION_BUILD ${RDTK_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${RDTK_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
${CMAKE_CURRENT_BINARY_DIR}/version.rc
@ONLY)
list (APPEND ${MODULE_PREFIX}_SRCS ${CMAKE_CURRENT_BINARY_DIR}/version.rc)
endif()
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
list(APPEND ${MODULE_PREFIX}_LIBS winpr)
list(APPEND ${MODULE_PREFIX}_LIBS freerdp)
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS})
target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${RDTK_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${RDTK_VERSION} SOVERSION ${RDTK_API_VERSION})
endif()
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "RdTk")
@ -49,6 +70,12 @@ if(BUILD_TESTING)
add_subdirectory(test)
endif()
if (NOT BUILD_SHARED_LIBS)
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT FreeRDP-ShadowTargets)
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT rdtk
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
if (WITH_DEBUG_SYMBOLS AND MSVC AND BUILD_SHARED_LIBS)
get_target_property(OUTPUT_FILENAME ${MODULE_NAME} OUTPUT_NAME)
install(FILES ${CMAKE_PDB_BINARY_DIR}/${OUTPUT_FILENAME}.pdb DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT symbols)
endif()

View File

@ -13,7 +13,7 @@ create_test_sourcelist(${MODULE_PREFIX}_SRCS
add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
target_link_libraries(${MODULE_NAME} rdtk)
target_link_libraries(${MODULE_NAME} winpr rdtk)
set_target_properties(${MODULE_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${TESTING_OUTPUT_DIRECTORY}")

3
rdtk/templates/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.h
*.pc
*.cmake

View File

@ -0,0 +1,45 @@
include (SetFreeRDPCMakeInstallDir)
set(RDTK_INCLUDE_DIR "include/rdtk${RDTK_VERSION_MAJOR}")
# cmake package
export(PACKAGE rdtk)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/rdtkConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/rdtkConfig.cmake
INSTALL_DESTINATION ${RDTK_CMAKE_INSTALL_DIR}
PATH_VARS RDTK_INCLUDE_DIR)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/rdtkConfigVersion.cmake
VERSION ${RDTK_VERSION}
COMPATIBILITY SameMajorVersion)
set(RDTK_BUILD_CONFIG_LIST "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^BUILTIN_CHANNELS|^HAVE_*")
LIST(APPEND RDTK_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()
string(REPLACE ";" " " RDTK_BUILD_CONFIG "${RDTK_BUILD_CONFIG_LIST}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/build-config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rdtk.pc.in ${CMAKE_CURRENT_BINARY_DIR}/rdtk${RDTK_VERSION_MAJOR}.pc @ONLY)
set(RDTK_INSTALL_INCLUDE_DIR include/rdtk${RDTK_API_VERSION}/rdtk)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/build-config.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h DESTINATION ${RDTK_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/rdtk${RDTK_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/rdtkConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/rdtkConfigVersion.cmake
DESTINATION ${RDTK_CMAKE_INSTALL_DIR})

View File

@ -0,0 +1,20 @@
#ifndef RDTK_BUILD_CONFIG_H
#define RDTK_BUILD_CONFIG_H
#define RDTK_DATA_PATH "${WINPR_DATA_PATH}"
#define RDTK_KEYMAP_PATH "${WINPR_KEYMAP_PATH}"
#define RDTK_PLUGIN_PATH "${WINPR_PLUGIN_PATH}"
#define RDTK_INSTALL_PREFIX "${WINPR_INSTALL_PREFIX}"
#define RDTK_LIBRARY_PATH "${WINPR_LIBRARY_PATH}"
#define RDTK_ADDIN_PATH "${WINPR_ADDIN_PATH}"
#define RDTK_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define RDTK_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}"
#define RDTK_VENDOR_STRING "${VENDOR}"
#define RDTK_PRODUCT_STRING "${PRODUCT}"
#endif /* RDTK_BUILD_CONFIG_H */

View File

@ -0,0 +1,11 @@
#ifndef RDTK_BUILD_FLAGS_H
#define RDTK_BUILD_FLAGS_H
#define CFLAGS "${CMAKE_C_FLAGS}"
#define COMPILER_ID "${CMAKE_C_COMPILER_ID}"
#define COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
#define TARGET_ARCH "${TARGET_ARCH}"
#define BUILD_CONFIG "${RDTK_BUILD_CONFIG}"
#define BUILD_TYPE "${CMAKE_BUILD_TYPE}"
#endif /* RDTK_BUILD_FLAGS_H */

View File

@ -0,0 +1,4 @@
#ifndef RDTK_CONFIG_H
#define RDTK_CONFIG_H
#endif /* RDTK_CONFIG_H */

15
rdtk/templates/rdtk.pc.in Normal file
View File

@ -0,0 +1,15 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=${prefix}/@RDTK_INCLUDE_DIR@
libs=-lrdtk@RDTK_VERSION_MAJOR@
Name: rdtk@RDTK_API_VERSION@
Description: rdtk:
URL: http://www.freerdp.com/
Version: @RDTK_VERSION@
Requires:
Requires.private: winpr@WINPR_VERSION_MAJOR@
Libs: -L${libdir} ${libs}
Libs.private:
Cflags: -I${includedir}

View File

@ -0,0 +1,9 @@
@PACKAGE_INIT@
set(RDTK_VERSION_MAJOR "@RDTK_VERSION_MAJOR@")
set(RDTK_VERSION_MINOR "@RDTK_VERSION_MINOR@")
set(RDTK_VERSION_REVISION "@RDTK_VERSION_REVISION@")
set_and_check(RDTK_INCLUDE_DIR "@PACKAGE_RDTK_INCLUDE_DIR@")
include("${CMAKE_CURRENT_LIST_DIR}/rdtk.cmake")

View File

@ -0,0 +1,32 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Version includes
*
* Copyright 2021 Thincast Technologies GmbH
* Copyright 2021 Armin Novak <armin.novak@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.
*/
#ifndef RDTK_VERSION_H
#define RDTK_VERSION_H
#define RDTK_VERSION_MAJOR ${RDTK_VERSION_MAJOR}
#define RDTK_VERSION_MINOR ${RDTK_VERSION_MINOR}
#define RDTK_VERSION_REVISION ${RDTK_VERSION_REVISION}
#define RDTK_VERSION_SUFFIX "${RDTK_VERSION_SUFFIX}"
#define RDTK_API_VERSION "${RDTK_API_VERSION}"
#define RDTK_VERSION "${RDTK_VERSION}"
#define RDTK_VERSION_FULL "${RDTK_VERSION_FULL}"
#define RDTK_GIT_REVISION "${GIT_REVISION}"
#endif /* RDTK_VERSION_H */

View File

@ -76,8 +76,6 @@ endforeach()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-server.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
export(PACKAGE freerdp-server)
SetFreeRDPCMakeInstallDir(FREERDP_SERVER_CMAKE_INSTALL_DIR "FreeRDP-Server${FREERDP_VERSION_MAJOR}")
@ -92,6 +90,6 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ServerConfigVersion.cmake
DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
if (NOT BUILTIN_CHANNELS)
install(EXPORT FreeRDP-ServerTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
endif()

View File

@ -64,7 +64,7 @@ set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
if(WITH_SERVER_INTERFACE)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
else()
set (RC_VERSION_FILE "${MODULE_NAME}${CMAKE_EXECUTABLE_SUFFIX}" )
endif()

View File

@ -43,7 +43,7 @@ if (WIN32)
set (RC_VERSION_MAJOR ${FREERDP_VERSION_MAJOR})
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
@ -60,8 +60,8 @@ if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${FREERDP_VERSION} SOVERSION ${FREERDP_API_VERSION})
endif()
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${FREERDP_CHANNELS_SERVER_LIBS})
target_link_libraries(${MODULE_NAME} ${PUBLIC_KEYWORD} winpr freerdp)
target_link_libraries(${MODULE_NAME} PRIVATE ${FREERDP_CHANNELS_SERVER_LIBS})
target_link_libraries(${MODULE_NAME} PUBLIC winpr freerdp)
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT FreeRDP-ServerTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@ -54,6 +54,14 @@ set(${MODULE_PREFIX}_SRCS
shadow_server.c
shadow.h)
if (NOT FREERDP_UNIFIED_BUILD)
find_package(rdtk 0 REQUIRED)
include_directories(${RDTK_INCLUDE_DIR})
else()
include_directories(${CMAKE_SOURCE_DIR}/rdtk/include)
include_directories(${CMAKE_BINARY_DIR}/rdtk/include)
endif()
# On windows create dll version information.
# Vendor, product and year are already set in top level CMakeLists.txt
if (WIN32)
@ -61,7 +69,7 @@ if (WIN32)
set (RC_VERSION_MINOR ${FREERDP_VERSION_MINOR})
set (RC_VERSION_BUILD ${FREERDP_VERSION_REVISION})
set (RC_VERSION_PATCH 0)
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${FREERDP_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
@ -79,7 +87,7 @@ list(APPEND ${MODULE_PREFIX}_LIBS winpr)
list(APPEND ${MODULE_PREFIX}_LIBS winpr-tools)
list(APPEND ${MODULE_PREFIX}_LIBS rdtk)
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS})
target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_VERSION_MAJOR})
if (WITH_LIBRARY_VERSIONING)
@ -287,7 +295,7 @@ add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-shadow freerdp winpr)
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS})
target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS})
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${FREERDP_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
@ -335,7 +343,7 @@ add_executable(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set(${MODULE_PREFIX}_LIBS ${${MODULE_PREFIX}_LIBS} freerdp-shadow-subsystem freerdp-shadow winpr)
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${${MODULE_PREFIX}_LIBS})
target_link_libraries(${MODULE_NAME} PRIVATE ${${MODULE_PREFIX}_LIBS})
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT server)
if (WITH_DEBUG_SYMBOLS AND MSVC)
@ -351,8 +359,6 @@ install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow-cli.1 1)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
export(PACKAGE freerdp-shadow)
SetFreeRDPCMakeInstallDir(FREERDP_SERVER_CMAKE_INSTALL_DIR "FreeRDP-Shadow${FREERDP_VERSION_MAJOR}")
@ -367,5 +373,6 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ShadowConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/FreeRDP-ShadowConfigVersion.cmake
DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
if (NOT BUILTIN_CHANNELS)
install(EXPORT FreeRDP-ShadowTargets DESTINATION ${FREERDP_SERVER_CMAKE_INSTALL_DIR})
endif()

View File

@ -23,30 +23,75 @@ set(UWAC_VERSION "${UWAC_VERSION_MAJOR}.${UWAC_VERSION_MINOR}.${UWAC_VERSION_REV
set(UWAC_VERSION_FULL "${UWAC_VERSION}")
set(UWAC_API_VERSION "${UWAC_VERSION_MAJOR}")
add_subdirectory(include)
add_subdirectory(libuwac)
if (NOT FREERDP_UNIFIED_BUILD)
cmake_minimum_required(VERSION 3.4)
project(uwac VERSION ${UWAC_VERSION} LANGUAGES C)
set(UWAC_INCLUDE_DIR "include/uwac${UWAC_VERSION_MAJOR}")
# cmake package
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
set(CMAKE_COLOR_MAKEFILE ON)
export(PACKAGE uwac)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
option(BUILD_TESTING "Build library unit tests" ON)
option(WITH_LIBRARY_VERSIONING "Use library version triplet" ON)
SetFreeRDPCMakeInstallDir(UWAC_CMAKE_INSTALL_DIR "uwac${UWAC_VERSION_MAJOR}")
configure_package_config_file(uwacConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/uwacConfig.cmake
INSTALL_DESTINATION ${UWAC_CMAKE_INSTALL_DIR}
PATH_VARS UWAC_INCLUDE_DIR)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
VERSION ${UWAC_VERSION} COMPATIBILITY SameMajorVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/uwacConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
DESTINATION ${UWAC_CMAKE_INSTALL_DIR})
install(EXPORT uwac DESTINATION ${UWAC_CMAKE_INSTALL_DIR})
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()
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uwac.pc.in ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
option(HAVE_PIXMAN_REGION "Use PIXMAN or FreeRDP for region calculations" "NOT FREERDP_UNIFIED_BUILD")
# Include our extra modules
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/)
# Check for cmake compatibility (enable/disable features)
include(FindFeature)
include(SetFreeRDPCMakeInstallDir)
include(CMakePackageConfigHelpers)
include(GNUInstallDirsWrapper)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
if (NOT IOS)
check_include_files(stdbool.h WINPR_HAVE_STDBOOL_H)
if (NOT WINPR_HAVE_STDBOOL_H)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../compat/stdbool)
endif()
else()
set(WINPR_HAVE_STDBOOL_H 1)
endif()
# Find required libraries
if (HAVE_PIXMAN_REGION)
include(FindPkgConfig)
pkg_check_modules(pixman REQUIRED pixman-1)
include_directories(${pixman_INCLUDE_DIRS})
add_definitions(-DHAVE_PIXMAN_REGION)
elseif (FREERDP_UNIFIED_BUILD)
include_directories(${CMAKE_SOURCE_DIR}/winpr/include)
include_directories(${CMAKE_BINARY_DIR}/winpr/include)
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR}/include)
else()
find_package(WinPR 3 REQUIRED)
find_package(FreeRDP 3 REQUIRED)
include_directories(${WinPR_INCLUDE_DIR})
include_directories(${FreeRDP_INCLUDE_DIR})
endif()
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})
include_directories(${CMAKE_CURRENT_BINARY_DIR}/templates)
add_subdirectory(libuwac)
add_subdirectory(include)
add_subdirectory(templates)

View File

@ -1,7 +1 @@
fullscreen-shell-client-protocol.h
fullscreen-shell-protocol.c
ivi-application-client-protocol.h
ivi-application-protocol.c
xdg-shell-client-protocol.h
xdg-shell-protocol.c
protocols/*

View File

@ -17,23 +17,24 @@
set(MODULE_NAME "uwac")
set(MODULE_PREFIX "UWAC")
set(GENERATED_SOURCES "")
macro(generate_protocol_file PROTO)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${PROTO}-protocol.c"
COMMAND ${WAYLAND_SCANNER} code < ${CMAKE_SOURCE_DIR}/uwac/protocols/${PROTO}.xml > ${CMAKE_CURRENT_BINARY_DIR}/${PROTO}-protocol.c
DEPENDS ${CMAKE_SOURCE_DIR}/uwac/protocols/${PROTO}.xml
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/protocols/${PROTO}-protocol.c"
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/protocols
COMMAND ${WAYLAND_SCANNER} code < ${CMAKE_CURRENT_SOURCE_DIR}/../protocols/${PROTO}.xml > ${CMAKE_CURRENT_BINARY_DIR}/protocols/${PROTO}-protocol.c
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../protocols/${PROTO}.xml
)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${PROTO}-client-protocol.h"
COMMAND ${WAYLAND_SCANNER} client-header < ${CMAKE_SOURCE_DIR}/uwac/protocols/${PROTO}.xml > ${CMAKE_CURRENT_BINARY_DIR}/${PROTO}-client-protocol.h
DEPENDS ${CMAKE_SOURCE_DIR}/uwac/protocols/${PROTO}.xml
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/protocols/${PROTO}-client-protocol.h"
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/protocols
COMMAND ${WAYLAND_SCANNER} client-header < ${CMAKE_CURRENT_SOURCE_DIR}/../protocols/${PROTO}.xml > ${CMAKE_CURRENT_BINARY_DIR}/protocols/${PROTO}-client-protocol.h
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../protocols/${PROTO}.xml
)
list(APPEND GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${PROTO}-client-protocol.h)
list(APPEND GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/${PROTO}-protocol.c)
list(APPEND GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/protocols/${PROTO}-client-protocol.h)
list(APPEND GENERATED_SOURCES ${CMAKE_CURRENT_BINARY_DIR}/protocols/${PROTO}-protocol.c)
endmacro()
generate_protocol_file(xdg-shell)
@ -48,9 +49,9 @@ if(FREEBSD)
endif()
include_directories(${WAYLAND_INCLUDE_DIR})
include_directories(${XKBCOMMON_INCLUDE_DIR})
include_directories("${CMAKE_SOURCE_DIR}/uwac/include")
include_directories("${CMAKE_BINARY_DIR}/uwac/include")
include_directories("${CMAKE_BINARY_DIR}/uwac/libuwac")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../include")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/../include")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/protocols")
add_definitions(-DBUILD_IVI -DBUILD_FULLSCREEN_SHELL -DENABLE_XKBCOMMON)
@ -70,16 +71,23 @@ set(${MODULE_PREFIX}_SRCS
add_library(${MODULE_NAME} ${${MODULE_PREFIX}_SRCS})
set_target_properties(${MODULE_NAME} PROPERTIES LINKER_LANGUAGE C)
set_target_properties(${MODULE_NAME} PROPERTIES OUTPUT_NAME ${MODULE_NAME}${UWAC_API_VERSION})
if (WITH_LIBRARY_VERSIONING)
set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${UWAC_VERSION} SOVERSION ${UWAC_API_VERSION})
endif()
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} ${PRIVATE_KEYWORD} ${WAYLAND_LIBS} ${XKBCOMMON_LIBS} ${EPOLLSHIM_LIBS} freerdp)
install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT uwac)
target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS} PRIVATE ${WAYLAND_LIBS} ${XKBCOMMON_LIBS} ${EPOLLSHIM_LIBS})
if (HAVE_PIXMAN_REGION)
target_link_libraries(${MODULE_NAME} PRIVATE ${pixman_LINK_LIBRARIES})
else()
target_link_libraries(${MODULE_NAME} PRIVATE freerdp)
endif()
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT uwac
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "uwac")

View File

@ -51,7 +51,7 @@
#include <string.h>
#include <sys/epoll.h>
#include "../config.h"
#include "config.h"
#include "uwac-os.h"
#include "uwac-utils.h"

3
uwac/templates/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.h
*.pc
*.cmake

View File

@ -0,0 +1,44 @@
set(UWAC_INCLUDE_DIR "include/uwac${UWAC_VERSION_MAJOR}")
# cmake package
export(PACKAGE uwac)
SetFreeRDPCMakeInstallDir(UWAC_CMAKE_INSTALL_DIR "uwac${UWAC_VERSION_MAJOR}")
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/uwacConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/uwacConfig.cmake
INSTALL_DESTINATION ${UWAC_CMAKE_INSTALL_DIR}
PATH_VARS UWAC_INCLUDE_DIR)
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
VERSION ${UWAC_VERSION}
COMPATIBILITY SameMajorVersion)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/uwacConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/uwacConfigVersion.cmake
DESTINATION ${UWAC_CMAKE_INSTALL_DIR})
install(EXPORT uwac DESTINATION ${UWAC_CMAKE_INSTALL_DIR})
set(UWAC_BUILD_CONFIG_LIST "")
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF (var MATCHES "^WITH_*|^BUILD_TESTING|^BUILTIN_CHANNELS|^HAVE_*")
LIST(APPEND UWAC_BUILD_CONFIG_LIST "${var}=${${var}}")
ENDIF()
ENDFOREACH()
string(REPLACE ";" " " UWAC_BUILD_CONFIG "${UWAC_BUILD_CONFIG_LIST}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/build-config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/uwac.pc.in ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc @ONLY)
set(UWAC_INSTALL_INCLUDE_DIR include/uwac${UWAC_API_VERSION}/uwac)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/version.h DESTINATION ${UWAC_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.h DESTINATION ${UWAC_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/build-config.h DESTINATION ${UWAC_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h DESTINATION ${UWAC_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

View File

@ -0,0 +1,22 @@
#ifndef UWAC_BUILD_CONFIG_H
#define UWAC_BUILD_CONFIG_H
#define UWAC_DATA_PATH "${WINPR_DATA_PATH}"
#define UWAC_KEYMAP_PATH "${WINPR_KEYMAP_PATH}"
#define UWAC_PLUGIN_PATH "${WINPR_PLUGIN_PATH}"
#define UWAC_INSTALL_PREFIX "${WINPR_INSTALL_PREFIX}"
#define UWAC_LIBRARY_PATH "${WINPR_LIBRARY_PATH}"
#define UWAC_ADDIN_PATH "${WINPR_ADDIN_PATH}"
#define UWAC_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define UWAC_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}"
#define UWAC_VENDOR_STRING "${VENDOR}"
#define UWAC_PRODUCT_STRING "${PRODUCT}"
#define UWAC_PROXY_PLUGINDIR "${WINPR_PROXY_PLUGINDIR}"
#endif /* UWAC_BUILD_CONFIG_H */

View File

@ -0,0 +1,11 @@
#ifndef UWAC_BUILD_FLAGS_H
#define UWAC_BUILD_FLAGS_H
#define CFLAGS "${CMAKE_C_FLAGS}"
#define COMPILER_ID "${CMAKE_C_COMPILER_ID}"
#define COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
#define TARGET_ARCH "${TARGET_ARCH}"
#define BUILD_CONFIG "${UWAC_BUILD_CONFIG}"
#define BUILD_TYPE "${CMAKE_BUILD_TYPE}"
#endif /* UWAC_BUILD_FLAGS_H */

View File

@ -0,0 +1,31 @@
#ifndef UWAC_CONFIG_H
#define UWAC_CONFIG_H
/* Include files */
#cmakedefine HAVE_FCNTL_H
#if defined(__APPLE__) && !defined(__IOS__)
#cmakedefine01 HAVE_UNISTD_H
#else
#cmakedefine HAVE_UNISTD_H
#endif
#cmakedefine HAVE_INTTYPES_H
#cmakedefine HAVE_SYS_MODEM_H
#cmakedefine HAVE_SYS_FILIO_H
#cmakedefine HAVE_SYS_SELECT_H
#cmakedefine HAVE_SYS_SOCKIO_H
#cmakedefine HAVE_SYS_STRTIO_H
#cmakedefine HAVE_SYS_EVENTFD_H
#cmakedefine HAVE_SYS_TIMERFD_H
#cmakedefine HAVE_TM_GMTOFF
#cmakedefine HAVE_AIO_H
#cmakedefine HAVE_POLL_H
#cmakedefine HAVE_SYSLOG_H
#cmakedefine HAVE_JOURNALD_H
#cmakedefine HAVE_PTHREAD_MUTEX_TIMEDLOCK
#cmakedefine HAVE_VALGRIND_MEMCHECK_H
#cmakedefine HAVE_EXECINFO_H
#cmakedefine HAVE_GETLOGIN_R
#cmakedefine HAVE_STRNDUP
#cmakedefine HAVE_PIXMAN_REGION
#endif /* UWAC_CONFIG_H */

View File

@ -4,7 +4,7 @@ libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=${prefix}/@UWAC_INCLUDE_DIR@
libs=-luwac@UWAC_VERSION_MAJOR@
Name: uwac
Name: uwac@UWAC_API_VERSION@
Description: uwac: using wayland as a client
URL: http://www.freerdp.com/
Version: @UWAC_VERSION@

View File

@ -0,0 +1,32 @@
/**
* FreeRDP: A Remote Desktop Protocol Implementation
* Version includes
*
* Copyright 2021 Thincast Technologies GmbH
* Copyright 2021 Armin Novak <armin.novak@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.
*/
#ifndef UWAC_VERSION_H
#define UWAC_VERSION_H
#define UWAC_VERSION_MAJOR ${UWAC_VERSION_MAJOR}
#define UWAC_VERSION_MINOR ${UWAC_VERSION_MINOR}
#define UWAC_VERSION_REVISION ${UWAC_VERSION_REVISION}
#define UWAC_VERSION_SUFFIX "${UWAC_VERSION_SUFFIX}"
#define UWAC_API_VERSION "${UWAC_API_VERSION}"
#define UWAC_VERSION "${UWAC_VERSION}"
#define UWAC_VERSION_FULL "${UWAC_VERSION_FULL}"
#define UWAC_GIT_REVISION "${GIT_REVISION}"
#endif /* UWAC_VERSION_H */

View File

@ -1,46 +0,0 @@
# This is a basic version file for the Config-mode of find_package().
# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
# the requested version string are exactly the same and it sets
# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
# but only if the requested major version is the same as the current one.
# The variable CVF_VERSION must be set before calling configure_file().
set(PACKAGE_VERSION "0.0.1")
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
if("0.0.1" MATCHES "^([0-9]+)\\.")
set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
else()
set(CVF_VERSION_MAJOR "0.0.1")
endif()
if("${PACKAGE_FIND_VERSION_MAJOR}" STREQUAL "${CVF_VERSION_MAJOR}")
set(PACKAGE_VERSION_COMPATIBLE TRUE)
else()
set(PACKAGE_VERSION_COMPATIBLE FALSE)
endif()
if( "${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
return()
endif()
# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
if(NOT "${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
math(EXPR installedBits "8 * 8")
set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
set(PACKAGE_VERSION_UNSUITABLE TRUE)
endif()

1
winpr/.gitignore vendored
View File

@ -1 +1,2 @@
tools/reg/winpr-reg
include/winpr/build-config.h

View File

@ -15,21 +15,31 @@
# See the License for the specific language governing permissions and
# limitations under the License.
if (NOT FREERDP_UNIFIED_BUILD)
cmake_minimum_required(VERSION 3.4)
project(WinPR C CXX)
project(WinPR LANGUAGES C)
set(CMAKE_COLOR_MAKEFILE ON)
option(WITH_LIBRARY_VERSIONING "Use library version triplet" ON)
# Default to build shared libs
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
option(EXPORT_ALL_SYMBOLS "Export all symbols form library" OFF)
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()
endif()
option(WITH_VERBOSE_WINPR_ASSERT "Compile with verbose WINPR_ASSERT." ON)
option(WITH_WINPR_TOOLS "Build WinPR helper binaries" ON)
if (WITH_VERBOSE_WINPR_ASSERT)
add_definitions(-DWITH_VERBOSE_WINPR_ASSERT)
endif()
if(FREERDP_VERSION)
set(FREERDP_BUILD 1)
endif()
# Include cmake modules
include(CheckIncludeFiles)
@ -45,11 +55,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/)
# Check for cmake compatibility (enable/disable features)
include(CheckCmakeCompat)
include(FindFeature)
include(ConfigOptions)
include(ComplexLibrary)
include(FeatureSummary)
include(CheckCCompilerFlag)
include(GNUInstallDirsWrapper)
include(InstallFreeRDPMan)
include(SetFreeRDPCMakeInstallDir)
include(CMakePackageConfigHelpers)
if (NOT WIN32)
@ -83,20 +94,22 @@ else()
endif()
if(NOT IOS)
check_include_files(stdbool.h WINPR_HAVE_STDBOOL_H)
check_include_files(stdint.h WINPR_HAVE_STDINT_H)
check_include_files(inttypes.h WINPR_HAVE_INTTYPES_H)
else(NOT IOS)
set(WINPR_HAVE_STDBOOL_H 1)
set(WINPR_HAVE_STDINT_H 1)
set(WINPR_HAVE_INTTYPES_H 1)
endif(NOT IOS)
if(FREERDP_BUILD)
set(WINPR_VERSION_FULL ${WINPR_VERSION_FULL} PARENT_SCOPE)
set(WINPR_VERSION ${WINPR_VERSION} PARENT_SCOPE)
set(WINPR_API_VERSION ${WINPR_API_VERSION} PARENT_SCOPE)
if (NOT IOS)
check_include_files(stdbool.h WINPR_HAVE_STDBOOL_H)
if (NOT WINPR_HAVE_STDBOOL_H)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../compat/stdbool)
endif()
else()
set(WINPR_HAVE_STDBOOL_H 1)
endif()
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
if(NOT IOS)
@ -141,7 +154,7 @@ else()
endif (HAVE_PTHREAD_MUTEX_TIMEDLOCK_SYMBOL OR HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIB OR HAVE_PTHREAD_MUTEX_TIMEDLOCK_LIBS)
endif()
set(OPENSSL_FEATURE_TYPE "OPTIONAL")
set(OPENSSL_FEATURE_TYPE "RECOMMENDED")
set(OPENSSL_FEATURE_PURPOSE "cryptography")
set(OPENSSL_FEATURE_DESCRIPTION "encryption, certificate validation, hashing functions")
@ -160,6 +173,10 @@ else()
add_definitions("-DWITH_MBEDTLS")
endif()
if (NOT OPENSSL_FOUND AND NOT MBEDTLS_FOUND)
message(FATAL_ERROR "OpenSSL or MBedTLS are required, none enabled/found")
endif()
# Include directories
include_directories(${CMAKE_CURRENT_BINARY_DIR})
@ -174,18 +191,12 @@ else()
else()
set(TESTING_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/Testing")
endif()
endif()
# Default to release build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
# Default to build shared libs
if(NOT DEFINED BUILD_SHARED_LIBS)
set(BUILD_SHARED_LIBS ON)
endif()
if(BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINPR_DLL")
endif()
@ -215,8 +226,6 @@ endif()
install_freerdp_man(wlog.7 7)
# Exporting
if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
export(PACKAGE winpr)
SetFreeRDPCMakeInstallDir(WINPR_CMAKE_INSTALL_DIR "WinPR${WINPR_VERSION_MAJOR}")
@ -235,10 +244,6 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.10")
install(EXPORT WinPRTargets DESTINATION ${WINPR_CMAKE_INSTALL_DIR})
endif()
if(FREERDP_BUILD)
set(WINPR_PKG_CONFIG_FILENAME winpr${WINPR_VERSION_MAJOR} PARENT_SCOPE)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr.pc.in ${CMAKE_CURRENT_BINARY_DIR}/winpr${WINPR_VERSION_MAJOR}.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr${WINPR_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/buildflags.h.in ${CMAKE_CURRENT_BINARY_DIR}/buildflags.h)

11
winpr/buildflags.h.in Normal file
View File

@ -0,0 +1,11 @@
#ifndef WINPR_BUILD_FLAGS_H
#define WINPR_BUILD_FLAGS_H
#define CFLAGS "${CMAKE_C_FLAGS}"
#define COMPILER_ID "${CMAKE_C_COMPILER_ID}"
#define COMPILER_VERSION "${CMAKE_C_COMPILER_VERSION}"
#define TARGET_ARCH "${TARGET_ARCH}"
#define BUILD_CONFIG "${WINPR_BUILD_CONFIG}"
#define BUILD_TYPE "${CMAKE_BUILD_TYPE}"
#endif /* WINPR_BUILD_FLAGS_H */

View File

@ -17,10 +17,12 @@
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/version.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr/wtypes.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/wtypes.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr/build-config.h.in ${CMAKE_CURRENT_BINARY_DIR}/winpr/build-config.h)
set(WINPR_INSTALL_INCLUDE_DIR include/winpr${WINPR_VERSION_MAJOR}/winpr)
file(GLOB WINPR_HEADERS "winpr/*.h")
install(FILES ${WINPR_HEADERS} DESTINATION ${WINPR_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr/version.h DESTINATION ${WINPR_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr/wtypes.h DESTINATION ${WINPR_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr/build-config.h DESTINATION ${WINPR_INSTALL_INCLUDE_DIR} COMPONENT headers)
install(DIRECTORY winpr/tools DESTINATION ${WINPR_INSTALL_INCLUDE_DIR} COMPONENT headers FILES_MATCHING PATTERN "*.h")

View File

@ -0,0 +1,22 @@
#ifndef WINPR_BUILD_CONFIG_H
#define WINPR_BUILD_CONFIG_H
#define WINPR_DATA_PATH "${WINPR_DATA_PATH}"
#define WINPR_KEYMAP_PATH "${WINPR_KEYMAP_PATH}"
#define WINPR_PLUGIN_PATH "${WINPR_PLUGIN_PATH}"
#define WINPR_INSTALL_PREFIX "${WINPR_INSTALL_PREFIX}"
#define WINPR_LIBRARY_PATH "${WINPR_LIBRARY_PATH}"
#define WINPR_ADDIN_PATH "${WINPR_ADDIN_PATH}"
#define WINPR_SHARED_LIBRARY_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}"
#define WINPR_SHARED_LIBRARY_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}"
#define WINPR_VENDOR_STRING "${VENDOR}"
#define WINPR_PRODUCT_STRING "${PRODUCT}"
#define WINPR_PROXY_PLUGINDIR "${WINPR_PROXY_PLUGINDIR}"
#endif /* WINPR_BUILD_CONFIG_H */

View File

@ -125,7 +125,7 @@ if (WIN32)
set (RC_VERSION_MAJOR ${WINPR_VERSION_MAJOR})
set (RC_VERSION_MINOR ${WINPR_VERSION_MINOR})
set (RC_VERSION_BUILD ${WINPR_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${WINPR_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
@ -144,7 +144,7 @@ if (WITH_LIBRARY_VERSIONING)
endif()
add_definitions(${WINPR_DEFINITIONS})
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${WINPR_LIBS_PRIVATE} ${PUBLIC_KEYWORD} ${WINPR_LIBS_PUBLIC})
target_link_libraries(${MODULE_NAME} PRIVATE ${WINPR_LIBS_PRIVATE} PUBLIC ${WINPR_LIBS_PUBLIC})
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT WinPRTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@ -29,7 +29,7 @@
#include <winpr/sysinfo.h>
#include <winpr/registry.h>
#include <winpr/endian.h>
#include <freerdp/build-config.h>
#include <winpr/build-config.h>
#include "ntlm.h"
#include "ntlm_export.h"
@ -40,7 +40,7 @@
#include "../../log.h"
#define TAG WINPR_TAG("sspi.NTLM")
#define WINPR_KEY "Software\\" FREERDP_VENDOR_STRING "\\" FREERDP_PRODUCT_STRING "\\WinPR\\NTLM"
#define WINPR_KEY "Software\\" WINPR_VENDOR_STRING "\\" WINPR_PRODUCT_STRING "\\WinPR\\NTLM"
static char* NTLM_PACKAGE_NAME = "NTLM";

View File

@ -92,7 +92,7 @@ if (WIN32)
set (RC_VERSION_MAJOR ${WINPR_VERSION_MAJOR})
set (RC_VERSION_MINOR ${WINPR_VERSION_MINOR})
set (RC_VERSION_BUILD ${WINPR_VERSION_REVISION})
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
set (RC_VERSION_FILE "${CMAKE_SHARED_LIBRARY_PREFIX}${MODULE_NAME}${WINPR_TOOLS_API_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}" )
configure_file(
${CMAKE_SOURCE_DIR}/cmake/WindowsDLLVersion.rc.in
@ -110,7 +110,7 @@ if (WITH_LIBRARY_VERSIONING)
endif()
add_definitions(${WINPR_DEFINITIONS})
target_link_libraries(${MODULE_NAME} ${PRIVATE_KEYWORD} ${WINPR_TOOLS_LIBS})
target_link_libraries(${MODULE_NAME} PRIVATE ${WINPR_TOOLS_LIBS})
install(TARGETS ${MODULE_NAME} COMPONENT libraries EXPORT WinPRTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}

View File

@ -1,4 +1,4 @@
.TH winpr-hash 1 2017-01-11 "@FREERDP_VERSION_FULL@" "FreeRDP"
.TH winpr-hash 1 2017-01-11 "@WINPR_VERSION_FULL@" "FreeRDP"
.SH NAME
winpr-hash \- NTLM hashing tool
.SH SYNOPSIS

View File

@ -2,7 +2,7 @@
\\$2 \(laURL: \\$1 \(ra\\$3
..
.if \n[.g] .mso www.tmac
.TH winpr\-makecert 1 2017-01-11 "@FREERDP_VERSION_FULL@" "FreeRDP"
.TH winpr\-makecert 1 2017-01-11 "@WINPR_VERSION_FULL@" "FreeRDP"
.SH NAME
winpr\-makecert \- A tool to create X.509 certificates.
.SH SYNOPSIS