Martchus / cpp-utilities

Common C++ classes and routines used by my applications such as argument parser, IO and conversion utilities
GNU General Public License v2.0
52 stars 18 forks source link

Wrong dir `include` if tag `CONFIGURATION_NAME` is set #25

Closed es20490446e closed 1 year ago

es20490446e commented 1 year ago

While building, if you add the flag CONFIGURATION_NAME, headers install into:

/usr/include/c++utilities-whatever/c++utilities

Instead of:

/usr/include/c++utilities-whatever

Martchus commented 1 year ago

This is correct behavior and important so includes like #include <c++utilities/application/global.h> still work - because that's how one is supposed to use headers of this library from external projects. If you use the CMake module or pkg-config correctly then the include path should be added automatically. Otherwise just add it as needed.

Martchus commented 1 year ago

Considering that Arch Linux and Debian packaging is using this feature I doubt it is buggy. If you nevertheless think so please provide more details to reproduce.

es20490446e commented 1 year ago

Let me have a look 👀

es20490446e commented 1 year ago

Okay, I figured it out by digging into the qtutilities Debian package and CMakeLists.txt.

While running cmake I had to add the flag CONFIGURATION_PACKAGE_SUFFIX.

I don't understand that while reading buildvariables.md.

It says:

  • Set CONFIGURATION_PACKAGE_SUFFIX to use libraries built with CONFIGURATION_NAME.

I guess it shall say something like:

  • Set PACKAGE_NAMESPACE_PREFIX to look for library headers with a custom prefix.
  • Set CONFIGURATION_PACKAGE_SUFFIX to look for library headers with a custom suffix.
Martchus commented 1 year ago

It should not say anything about headers because that's too specific. This is about all kinds of files the library consists of (the library itself, CMake modules, scripts, …).

PACKAGE_NAMESPACE_PREFIX should have documentation. This feature has been contributed by Debian and they didn't add documentation at the time.

es20490446e commented 1 year ago

It can say: "for example headers".

Martchus commented 1 year ago

I've just pushed a documentation change. So I suppose this issue can be closed.

es20490446e commented 1 year ago

Thanks! 👌