aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDawid Wróbel <me@dawidwrobel.com>2021-10-04 22:40:14 +0300
committerGitHub <noreply@github.com>2021-10-04 12:40:14 -0700
commit7aa1a14c5f5707373b73e909ed6aa12b7bae8ee7 (patch)
treea69d8c52a3ea82d42e167561ecc83857a5d15d57 /scripts
parentf670aa5657fe1b1b4524b57a334fb75baf4e34b2 (diff)
downloadvcpkg-7aa1a14c5f5707373b73e909ed6aa12b7bae8ee7.tar.gz
vcpkg-7aa1a14c5f5707373b73e909ed6aa12b7bae8ee7.zip
[vcpkg_copy_tools] support copying .app bundles (#20210)
* [vcpkg_copy_tools] support copying .app bundles * check for VCPKG_TARGET_IS_OSX * Fix formatting * [vcpkg_copy_tools] copy bundle and plain bin if both present * Update scripts/cmake/vcpkg_copy_tools.cmake Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com> Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/cmake/vcpkg_common_definitions.cmake15
-rw-r--r--scripts/cmake/vcpkg_copy_tools.cmake8
2 files changed, 23 insertions, 0 deletions
diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake
index e53d93963..40c8183f1 100644
--- a/scripts/cmake/vcpkg_common_definitions.cmake
+++ b/scripts/cmake/vcpkg_common_definitions.cmake
@@ -9,6 +9,8 @@ VCPKG_HOST_IS_<host> with <host> being one of the following:
VCPKG_HOST_PATH_SEPARATOR Host specific path separator (USAGE: "<something>${VCPKG_HOST_PATH_SEPARATOR}<something>"; only use and pass variables with VCPKG_HOST_PATH_SEPARATOR within "")
VCPKG_HOST_EXECUTABLE_SUFFIX executable suffix of the host
VCPKG_TARGET_EXECUTABLE_SUFFIX executable suffix of the target
+VCPKG_HOST_BUNDLE_SUFFIX bundle suffix of the host
+VCPKG_TARGET_BUNDLE_SUFFIX bundle suffix of the target
VCPKG_TARGET_STATIC_LIBRARY_PREFIX static library prefix for target (same as CMAKE_STATIC_LIBRARY_PREFIX)
VCPKG_TARGET_STATIC_LIBRARY_SUFFIX static library suffix for target (same as CMAKE_STATIC_LIBRARY_SUFFIX)
VCPKG_TARGET_SHARED_LIBRARY_PREFIX shared library prefix for target (same as CMAKE_SHARED_LIBRARY_PREFIX)
@@ -88,6 +90,19 @@ else()
set(VCPKG_TARGET_EXECUTABLE_SUFFIX "")
endif()
+#Helper variables to identify bundles on host/target
+if(VCPKG_HOST_IS_OSX)
+ set(VCPKG_HOST_BUNDLE_SUFFIX ".app")
+else()
+ set(VCPKG_HOST_BUNDLE_SUFFIX "")
+endif()
+
+if(VCPKG_TARGET_IS_OSX)
+ set(VCPKG_TARGET_BUNDLE_SUFFIX ".app")
+else()
+ set(VCPKG_TARGET_BUNDLE_SUFFIX "")
+endif()
+
#Helper variables for libraries
if(VCPKG_TARGET_IS_MINGW)
set(VCPKG_TARGET_STATIC_LIBRARY_SUFFIX ".a")
diff --git a/scripts/cmake/vcpkg_copy_tools.cmake b/scripts/cmake/vcpkg_copy_tools.cmake
index ef3259840..af4a457ff 100644
--- a/scripts/cmake/vcpkg_copy_tools.cmake
+++ b/scripts/cmake/vcpkg_copy_tools.cmake
@@ -58,6 +58,14 @@ function(vcpkg_copy_tools)
set(tool_pdb "${arg_SEARCH_DIR}/${tool_name}.pdb")
if(EXISTS "${tool_path}")
file(COPY "${tool_path}" DESTINATION "${arg_DESTINATION}")
+ elseif(NOT "${VCPKG_TARGET_BUNDLE_SUFFIX}" STREQUAL "" AND NOT "${VCPKG_TARGET_BUNDLE_SUFFIX}" STREQUAL "${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
+ set(bundle_path "${arg_SEARCH_DIR}/${tool_name}${VCPKG_TARGET_BUNDLE_SUFFIX}")
+ if(EXISTS "${bundle_path}")
+ file(COPY "${bundle_path}" DESTINATION "${arg_DESTINATION}")
+ else()
+ message(FATAL_ERROR "Couldn't find tool \"${tool_name}\":
+ neither \"${tool_path}\" nor \"${bundle_path}\" exists")
+ endif()
else()
message(FATAL_ERROR "Couldn't find tool \"${tool_name}\":
\"${tool_path}\" does not exist")