Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/maintainers/vcpkg_common_definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,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)
Expand Down
15 changes: 15 additions & 0 deletions scripts/cmake/vcpkg_common_definitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
8 changes: 8 additions & 0 deletions scripts/cmake/vcpkg_copy_tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down