Skip to content

Conversation

@cursey
Copy link
Contributor

@cursey cursey commented Jan 29, 2022

Sometimes you want a component to install a target, as well as some files. For example:

[[install]]
targets = ["MHRISE"]
destination = "MHRISE"

[[install]]
destination = "MHRISE"
files = ["dependencies/openvr/bin/win64/openvr_api.dll"]

This creates two install components, one which inherits the name of the target (MHRISE) and one that doesn't belong to any install component.

This PR lets you specify a component for the install so that you can do something like:

[[install]]
targets = ["MHRISE"]
destination = "MHRISE"
component = "MHRISE" # optional since its the same as the first target name

[[install]]
destination = "MHRISE"
files = ["dependencies/openvr/bin/win64/openvr_api.dll"]
component = "MHRISE"

Which lets you install the specific component along with the required files via command line:

cmake --install <build folder> --component MHRISE --prefix install

I found this necessary since while cmkr doesn't complain about the following:

[[install]]
targets = ["MHRISE"]
destination = "MHRISE"
files = ["dependencies/openvr/bin/win64/openvr_api.dll"]

CMake complains with: [cmake] install TARGETS given target "FILES" which does not exist.

@mrexodia mrexodia merged commit e7d9faa into build-cpp:main Jan 29, 2022
@mrexodia
Copy link
Contributor

Awesome, thanks!

@cursey cursey deleted the improvement/install-component branch January 29, 2022 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants