vcpkg/ports/freerdp/portfile.cmake

139 lines
5.1 KiB
CMake
Raw Normal View History

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO FreeRDP/FreeRDP
REF "${VERSION}"
2024-03-16 09:40:03 +08:00
SHA512 aa96ad2bf30dbe09849ecfb64ec6e60ba4fd3bc2d144c7d576b1e59476ef45d9d744da37806b1c00e3a0413390b35c6d3d4401b89c07c5663122280eca39e501
HEAD_REF master
PATCHES
2023-12-23 04:53:15 +08:00
dependencies.patch
install-layout.patch
keep-dup-libs.patch
2023-12-23 04:53:15 +08:00
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)
list(APPEND tools wfreerdp-server)
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
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/freerdp/build-config.h" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" ".")
2022-01-07 07:35:44 +08:00
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/freerdp/build-config.h" "${CURRENT_PACKAGES_DIR}/" "")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/freerdp/build-config.h" "${CURRENT_PACKAGES_DIR}" "")
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.
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/freerdp/api.h" "#ifdef FREERDP_EXPORTS" "#if 1")
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
file(REMOVE_RECURSE
2023-12-23 04:53:15 +08:00
"${CURRENT_PACKAGES_DIR}/include/config"
"${CURRENT_PACKAGES_DIR}/include/CMakeFiles"
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
2023-12-23 04:53:15 +08:00
file(GLOB cmakefiles "${CURRENT_PACKAGES_DIR}/include/*/CMakeFiles")
if(cmakefiles)
file(REMOVE_RECURSE ${cmakefiles})
endif()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")