aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/scripts/test_ports/rpath-macho-test-binaries/portfile.cmake
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/scripts/test_ports/rpath-macho-test-binaries/portfile.cmake
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/scripts/test_ports/rpath-macho-test-binaries/portfile.cmake')
-rw-r--r--vcpkg/scripts/test_ports/rpath-macho-test-binaries/portfile.cmake46
1 files changed, 46 insertions, 0 deletions
diff --git a/vcpkg/scripts/test_ports/rpath-macho-test-binaries/portfile.cmake b/vcpkg/scripts/test_ports/rpath-macho-test-binaries/portfile.cmake
new file mode 100644
index 0000000..960fd7b
--- /dev/null
+++ b/vcpkg/scripts/test_ports/rpath-macho-test-binaries/portfile.cmake
@@ -0,0 +1,46 @@
+set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
+vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${CURRENT_PORT_DIR}/project"
+ OPTIONS_RELEASE
+ -DTEST_STRING=release
+ OPTIONS_DEBUG
+ -DTEST_STRING=debug
+)
+vcpkg_cmake_install()
+
+function(make_rpath_absolute lib_dir)
+string(REPLACE "/" "_" logname "make_rpath_absolute-${lib_dir}")
+ vcpkg_execute_required_process(
+ COMMAND "install_name_tool" -id ${CURRENT_INSTALLED_DIR}/${lib_dir}/librpath-macho-backend-lib++.dylib ${CURRENT_PACKAGES_DIR}/${lib_dir}/librpath-macho-backend-lib++.dylib
+ WORKING_DIRECTORY "${CURRENT_PACKAGES_DIR}"
+ LOGNAME "${logname}-id"
+ )
+
+ vcpkg_execute_required_process(
+ COMMAND "install_name_tool" -change @rpath/librpath-macho-backend-lib++.dylib ${CURRENT_INSTALLED_DIR}/${lib_dir}/librpath-macho-backend-lib++.dylib ${CURRENT_PACKAGES_DIR}/${lib_dir}/librpath-macho-test-lib.dylib
+ WORKING_DIRECTORY "${CURRENT_PACKAGES_DIR}"
+ LOGNAME "${logname}-change"
+ )
+endfunction()
+
+if(NOT VCPKG_BUILD_TYPE)
+ vcpkg_copy_tools(TOOL_NAMES rpath-macho-test-tool
+ SEARCH_DIR "${CURRENT_PACKAGES_DIR}/debug/bin"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/debug/tools/${PORT}"
+ )
+ vcpkg_copy_tools(TOOL_NAMES rpath-macho-test-tool
+ SEARCH_DIR "${CURRENT_PACKAGES_DIR}/debug/bin"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}/debug"
+ )
+ vcpkg_copy_tools(TOOL_NAMES rpath-macho-test-tool
+ SEARCH_DIR "${CURRENT_PACKAGES_DIR}/debug/bin"
+ DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug"
+ )
+ make_rpath_absolute("debug/lib")
+endif()
+make_rpath_absolute("lib")
+vcpkg_copy_tools(TOOL_NAMES rpath-macho-test-tool DESTINATION "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}")
+vcpkg_copy_tools(TOOL_NAMES rpath-macho-test-tool AUTO_CLEAN)
+file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "This test port is part of vcpkg.")