Skip to content

Allow specifying install component name #51

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

Merged
merged 1 commit into from
Jan 29, 2022
Merged

Allow specifying install component name #51

merged 1 commit into from
Jan 29, 2022

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