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

cmake: Introduce Libmultiprocess_INSTALL_PKGCONFIG_FILE build option #112

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hebasto
Copy link
Contributor

@hebasto hebasto commented Sep 23, 2024

This PR makes the installation of the pkgconfig/libmultiprocess.pc file optional.

Comment on lines +94 to +95
configure_file(pkgconfig/libmultiprocess.pc.in "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/libmultiprocess.pc" @ONLY)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/libmultiprocess.pc"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, the pkgconfig subdirectory seems redundant here, no?

@fanquake
Copy link
Contributor

Is there a particular reason to not install it by default? Note that pkg-config is just a generic tool, and it's usage is not specific to Autotools. Meson and other build systems also use it.

This change makes the installation of the `pkgconfig/libmultiprocess.pc`
file optional.
@hebasto
Copy link
Contributor Author

hebasto commented Sep 23, 2024

Is there a particular reason to not install it by default? Note that pkg-config is just a generic tool, and it's usage is not specific to Autotools. Meson and other build systems also use it.

The default value of the new option has been changed to ON.

@ryanofsky
Copy link
Collaborator

What's the motivation for this change? It seems like an unusual thing for a package to have a configuration option to not fully install itself. And if installing a .pc file is optional, should installing .cmake package files be optional also? I think I'd prefer the cmake code here to be as vanilla as possible and not have a non-standard option like this, unless there is a real reason why it's useful.

Also it seems would seem better to just use cmake components to control what is installed instead of using both cmake components and cmake options to control what is installed. Maybe installed metadata files could be moved into different components to provide finer-grained control over what to install if this is necessary.

@hebasto
Copy link
Contributor Author

hebasto commented Sep 24, 2024

What's the motivation for this change?

Currently, the package built in Bitcoin Core depends looks like that:

$ tree
.
├── include
│   └── mp
│       ├── proxy.capnp.h
│       ├── proxy.h
│       ├── proxy-io.h
│       ├── proxy-types.h
│       └── util.h
└── lib
    ├── cmake
    │   └── Libmultiprocess
    │       ├── LibmultiprocessConfig.cmake
    │       ├── LibTargets.cmake
    │       └── LibTargets-noconfig.cmake
    ├── libmultiprocess.a
    └── pkgconfig
        └── libmultiprocess.pc

7 directories, 10 files

The pkgconfig/libmultiprocess.pc file is not needed. Alternatively, it can be deleted during postprocessing, as we do with other packages.

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.

3 participants