Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

relocatable full_deploy CMake #13526

Conversation

memsharded
Copy link
Member

@memsharded memsharded commented Mar 24, 2023

Changelog: Feature: The full_deploy deployer together with CMakeDeps generator learned to create relative paths deploys, so they are relocatable.
Docs: Omit

Close #13511

@memsharded memsharded added this to the 2.0.3 milestone Mar 24, 2023
@memsharded memsharded self-assigned this Mar 27, 2023
for varname, varvalues in self._values.items():
value = varvalues.get_str("%{name}%", subsystem=self._subsystem, pathsep=self._pathsep)
# To make the script relocatable
value = value.replace(location, "%~dp0")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was easy to make Env generators to be relocatable for Windows/.bat, but it is challenging to do for .sh in Linux, due to not existing a generic pure shell (no bash only) solution

else:
updates[prop_name] = os.path.join(folder, value)
component._generator_properties.update(updates)
properties = component._generator_properties
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a minor refactor, no need to iterate all properties, if only 1 used ( I had to do the same below)

@@ -15,8 +17,30 @@
def test_install_deploy():
c = TestClient()
c.run("new cmake_lib -d name=hello -d version=0.1")
c.run("create . -o *:shared=True -tf=")
conanfile = textwrap.dedent("""
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding an actual executable script to the test, to proof the final deploy is relocatable

@memsharded memsharded merged commit 3c49627 into conan-io:release/2.0 Mar 31, 2023
2 checks passed
@memsharded memsharded deleted the feature/relocatable_cmake_full_deploy branch March 31, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deploy thirdparties in conan 2.X
2 participants