vcpkg_copy_tools: Handle versioned executable installed by CMake

Created on 24 May 2020  路  4Comments  路  Source: microsoft/vcpkg

Is your feature request related to a problem? Please describe.
Some CMake ports set the VERSION target for the installed executable, that on Linux as the effect that executable_name is not a real executable, but just a symlink to the real executable called executable_name-version (see the NAMELINK-related options in https://cmake.org/cmake/help/v3.17/command/install.html#installing-targets for more details).
The current form of vcpkg_copy_tools ignores the real executable called executable_name-version, and just copy in tools/${PORT} the symlink executable_name.

Proposed solution
I do not have a solution, I opened the issue so we can have a space where to discuss a possible solution.

Possible solutions include:

  • Teach vcpkg_copy_tools to also find and install tools in the form toolsname-{version}
  • Patch all the affected ports to avoid that they set the VERSION properties in the executables
vcpkg-bug

All 4 comments

Hmm maybe idiotic idea. But why not pass -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CURRENT_PACKAGES_DIR}/tools/${port} via vcpkg_configure_cmake for everything except windows?

Hmm maybe idiotic idea. But why not pass -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=${CURRENT_PACKAGES_DIR}/tools/${port} via vcpkg_configure_cmake for everything except windows?

I don't know, I am afraid that mixing the logic of where to place build artifacts and where to install them can have several unwanted consequences.

Recursive copy the file until its not a symlink ?
https://cmake.org/cmake/help/v3.14/command/file.html: file(READ_SYMLINK <linkname> <out-var>)

cc @BillyONeal

Was this page helpful?
0 / 5 - 0 ratings