Skip to content

CMake: Generate pkg-config .pc file#532

Merged
ax3l merged 2 commits intoopenPMD:devfrom
ax3l:topic-pkgconfig
Jul 19, 2019
Merged

CMake: Generate pkg-config .pc file#532
ax3l merged 2 commits intoopenPMD:devfrom
ax3l:topic-pkgconfig

Conversation

@ax3l
Copy link
Member

@ax3l ax3l commented Jul 18, 2019

Generate .pc files for consumption via pkg-config. This is useful for projects with legacy build environments that do not use a build system generator such as CMake and instead write Makefiles by hand or even compile manually by calling the compiler directly.

Example to update downstream: WarpX BLAST-WarpX/warpx#80

Also removes the public defines for "variants" of the installed library from the build system and instead pulls them automatically in the facade headers via a openPMD/config.hpp file. Since the library "variant" cannot be changed after the fact anyway, this avoids having to set magic defines downstream.

@ax3l ax3l added the install label Jul 18, 2019
@ax3l ax3l force-pushed the topic-pkgconfig branch 3 times, most recently from 25a5199 to 7223b02 Compare July 18, 2019 23:51
@ax3l ax3l changed the title [WIP] CMake: Generate pkg-config .pc file CMake: Generate pkg-config .pc file Jul 19, 2019
Additional linker and compiler flags for your project are available via:
```bash
pkg-config --libs openPMD
# -L${HOME}/somepath/lib -lopenPMD
Copy link
Member Author

Choose a reason for hiding this comment

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

note: the --static output requires proper listing of Libs.private which is non-trivial. Luckily, we changed the default build variant to shared #505 for the next release, so pkg-config installs are only supported with shared builds for now, which is a sane limitation.

Generate .pc files for consumption via pkg-config.
This is useful for projects with legacy build environments that do
not use a build system generator such as CMake and instead write
Makefiles by hand or compile manually.
@ax3l ax3l force-pushed the topic-pkgconfig branch 8 times, most recently from e0c1f00 to e61cbd0 Compare July 19, 2019 16:49
@ax3l ax3l requested a review from franzpoeschel July 19, 2019 18:35
@ax3l ax3l force-pushed the topic-pkgconfig branch from e61cbd0 to 3f97965 Compare July 19, 2019 18:39
Instead of adding public defines for variants of the openPMD-api
library, configure a `openPMD/config.hpp` header that does the
same job.

These variants cannot be changed after install anyway and avoid
complicated exposure via the build system instead of just using
our facade headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant