[CMake] Contribute Find-module to CMake vs Config-file to upstream

Paul Fultz II pfultz2 at yahoo.com
Tue May 22 22:06:17 EDT 2018


> On May 22, 2018, at 10:13 AM, Brad King <brad.king at kitware.com> wrote:
> 
> On 05/22/2018 06:27 AM, Johannes Zarl-Zierl wrote:
>> There's more that we (as CMake community) could do to make it easier for non-
>> cmake projects to add a config file...
> [snip]
>> not be much more work for the maintainer as pkg-config files.
> 
> There is a proposal here:
> 
>  https://mwoehlke.github.io/cps/
> 
> for a new package specification format to supersede both CMake
> package configuration files and pkg-config .pc files with something
> sufficient for both use cases.  The "History" section documents
> the limitations of both existing approaches and why neither is
> sufficient on its own.

Or pkg-config could be extended to fix the issues. A `Replaces:` field could be added to support resolving c++11 and c++14 language flags(although changing c++ languages version is a very bad idea and can cause ABI breakage, which why it should be a property of the toolchain).

Also, the link line could support passing the full path to the library rather than using `-L` and `-l` flags. 

> 
> Both pkg-config and CMake's find_package command could use the
> proposed `.cps` files.  Projects would only have to provide one
> kind of spec file that is buildsystem agnostic.

In the Boost Cmake Modules, we support generating both pkg-config and cmake config files automatically from the cmake targets:

http://bcm.readthedocs.io/en/latest/src/BCMExport.html#bcm-auto-export
http://bcm.readthedocs.io/en/latest/src/BCMPkgConfig.html#bcm-auto-pkgconfig

Paul



More information about the CMake mailing list