vcpkg/ports/freerdp/portfile.cmake

132 lines
4.8 KiB
CMake
Raw Normal View History

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO FreeRDP/FreeRDP
REF "${VERSION}"
2024-10-22 09:36:48 +08:00
SHA512 72d978326a3641e69706c158cd5c4b1a4138dedbe1bf8c0f1c02fbb03291c1a49ff36afdaf8cf432fee84952bbaecf8801efa3f1afb50f600490e36ec3d577ef
HEAD_REF master
PATCHES
2023-12-23 04:53:15 +08:00
dependencies.patch
install-layout.patch
windows-linkage.patch
)
file(WRITE "${SOURCE_PATH}/.source_version" "${VERSION}-vcpkg")
2024-03-12 11:14:24 +08:00
file(WRITE "${SOURCE_PATH}/CMakeCPack.cmake" "")
if("x11" IN_LIST FEATURES)
message(STATUS "${PORT} currently requires the following libraries from the system package manager:\n libxfixes-dev\n")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
2023-12-23 04:53:15 +08:00
ffmpeg WITH_FFMPEG
ffmpeg WITH_SWSCALE
server WITH_SERVER
urbdrc CHANNEL_URBDRC
wayland WITH_WAYLAND
winpr-tools WITH_WINPR_TOOLS
2023-12-23 04:53:15 +08:00
x11 WITH_X11
)
vcpkg_list(SET GENERATOR_OPTION)
if(VCPKG_TARGET_IS_OSX)
list(APPEND GENERATOR_OPTION GENERATOR "Unix Makefiles")
endif()
vcpkg_find_acquire_program(PKGCONFIG)
2021-11-30 09:05:12 +08:00
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
${GENERATOR_OPTION}
OPTIONS
${FEATURE_OPTIONS}
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
2023-12-23 04:53:15 +08:00
-DCMAKE_REQUIRE_FIND_PACKAGE_cJSON=ON
-DUSE_VERSION_FROM_GIT_TAG=OFF
-DWITH_AAD=ON
-DWITH_CCACHE=OFF
-DWITH_CLANG_FORMAT=OFF
-DWITH_MANPAGES=OFF
-DWITH_OPENSSL=ON
2023-12-23 04:53:15 +08:00
-DWITH_SAMPLE=OFF
-DWITH_UNICODE_BUILTIN=ON
-DWITH_CLIENT=OFF
"-DMSVC_RUNTIME=${VCPKG_CRT_LINKAGE}"
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
-DPKG_CONFIG_USE_CMAKE_PREFIX_PATH=ON
2023-12-23 04:53:15 +08:00
# Uncontrolled dependencies w.r.t. vcpkg ports, system libs, or tools
# Can be overriden in custom triplet file
2023-12-23 04:53:15 +08:00
-DUSE_UNWIND=OFF
-DWITH_ALSA=OFF
-DWITH_CAIRO=OFF
2023-12-23 04:53:15 +08:00
-DWITH_CLIENT_SDL=OFF
-DWITH_CUPS=OFF
-DWITH_FUSE=OFF
-DWITH_KRB5=OFF
-DWITH_LIBSYSTEMD=OFF
2023-12-23 04:53:15 +08:00
-DWITH_OPUS=OFF
-DWITH_OSS=OFF
-DWITH_PCSC=OFF
-DWITH_PKCS11=OFF
-DWITH_PROXY_MODULES=OFF
-DWITH_PULSE=OFF
-DWITH_URIPARSER=OFF
-DVCPKG_TRACE_FIND_PACKAGE=ON
MAYBE_UNUSED_VARIABLES
MSVC_RUNTIME
)
2021-11-30 09:05:12 +08:00
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
vcpkg_list(SET tools)
if(VCPKG_TARGET_IS_WINDOWS)
if("server" IN_LIST FEATURES)
2024-10-22 09:36:48 +08:00
list(APPEND tools wfreerdp-server-cli)
endif()
elseif(VCPKG_TARGET_IS_OSX)
if("server" IN_LIST FEATURES)
list(APPEND tools mfreerdp-server)
endif()
endif()
if("server" IN_LIST FEATURES)
list(APPEND tools freerdp-proxy freerdp-shadow-cli)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/FreeRDP-Proxy3 PACKAGE_NAME freerdp-Proxy3 DO_NOT_DELETE_PARENT_CONFIG_PATH)
2023-12-23 04:53:15 +08:00
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/FreeRDP-Server3 PACKAGE_NAME freerdp-server3 DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/FreeRDP-Shadow3 PACKAGE_NAME freerdp-shadow3 DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/rdtk0 PACKAGE_NAME rdtk0 DO_NOT_DELETE_PARENT_CONFIG_PATH)
endif()
if("wayland" IN_LIST FEATURES)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/uwac0 PACKAGE_NAME uwac0 DO_NOT_DELETE_PARENT_CONFIG_PATH)
endif()
if("winpr-tools" IN_LIST FEATURES)
list(APPEND tools winpr-hash winpr-makecert)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/WinPR-tools3 PACKAGE_NAME winpr-tools3 DO_NOT_DELETE_PARENT_CONFIG_PATH)
endif()
2023-12-23 04:53:15 +08:00
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/FreeRDP-Client3 PACKAGE_NAME freerdp-client3 DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/WinPR3 PACKAGE_NAME winpr3 DO_NOT_DELETE_PARENT_CONFIG_PATH)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/FreeRDP3 PACKAGE_NAME freerdp)
if(tools)
vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN)
endif()
2021-11-30 09:05:12 +08:00
2024-10-22 09:36:48 +08:00
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/freerdp3/freerdp/build-config.h" "\"${CURRENT_PACKAGES_DIR}" "/* vcpkg redacted */ \"" IGNORE_UNCHANGED)
2023-12-23 04:53:15 +08:00
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# They build static with dllexport, so it must be used with dllexport. Proper fix needs invasive patching.
2024-10-22 09:36:48 +08:00
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/freerdp3/freerdp/api.h" "#ifdef FREERDP_EXPORTS" "#if 1")
2023-12-23 04:53:15 +08:00
if(WITH_SERVER)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/rdtk0/rdtk/api.h" "#ifdef RDTK_EXPORTS" "#if 1")
endif()
endif()
2021-11-30 09:05:12 +08:00
2024-10-22 09:36:48 +08:00
file(GLOB cmakefiles "${CURRENT_PACKAGES_DIR}/include/*/CMakeFiles")
file(REMOVE_RECURSE
2024-10-22 09:36:48 +08:00
${cmakefiles}
"${CURRENT_PACKAGES_DIR}/include/winpr3/config"
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
2023-12-23 04:53:15 +08:00
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")