bugGNU libunistring - Bugs: bug #53717, Workflows that rely on pkgconfig...


You are not allowed to post comments on this tracker with your current authentication level.

bug #53717: Workflows that rely on pkgconfig are unhappy with libunistring's lack of .pc file

Submitted by:  Dan Kegel <dankegel>
Submitted on:  Sun 22 Apr 2018 02:33:20 PM UTC  
Category:  Interface Severity:  3 - Normal
Item Group:  None Status:  Need Info
Privacy:  Public Assigned to:  Bruno Haible <haible>
Open/Closed:  Open

Sun 22 Apr 2018 09:07:18 PM UTC, comment #5:

Thanks! This is helpful.

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sun 22 Apr 2018 07:07:09 PM UTC, comment #4:

I think to be truly cmake native, one would not use find_library, as that gets in the way of a truly reusable CMakeLists.txt in which one can use it standalone or in a supertree build. It's old school and slightly deprecated.

Instead, one uses FindPackage(). See page 38 et seq of

Dan Kegel <dankegel>
Sun 22 Apr 2018 06:55:49 PM UTC, comment #3:

Then, can anyone else please answer the question:

If you try to search for an installed libunistring using the CMake command 'find_library', what does the CMake script look like, and what issues do you encounter?

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sun 22 Apr 2018 06:16:37 PM UTC, comment #2:

Two notes:

- try searching for pkg-config instead, it's usually spelled that way. Still a small number of hits, but not as small.

- Don't forget gnome/gstreamer's meson. It's just getting started, but I recently submitted a patch to add cmake support for building an open source project, but they said "Wait, aren't all the cool kids going to meson instead of cmake?" and merged a meson build configuration instead.

And fwiw it appears that meson likes pkgconfig, see

For the people who do rely on pkg-config, supporting it would be a blessing. I understand you want to avoid that because pkg-config is less than perfect, but I assure you it's still very useful.

My cmake projects use pkg-config exclusively to find dependencies; it's far easier for me than using cmake's native stuff. (cmake suffers from "magical alien software syndrome"; a lot of their documentation is completely unintelligible to me because it is so, so different from standard unix/linux practice.)

Dan Kegel <dankegel>
Sun 22 Apr 2018 05:36:21 PM UTC, comment #1:

> the world no longer revolves around autoconf

Indeed, when I do a trends.google.com comparison between autoconf, cmake, scons, gradle, pkgconfig,
I can see the following trends:
- Gradle has "taken off" in 2013.
- CMake has "taken off" in 2006 and seen increasing use since 2016.
- Interest in autoconf has strongly declined.
- Interest in SCons was as its maximum in 2006 and has since declined, like autoconf.
- Interest in pkg-config has dropped as well.

Gradle is mostly used for JavaScript and Java, I understand. So let's ignore it here.

Then, what we need is good support for locating libunistring in CMake.

But CMake has built-in support for finding libraries. See

pkg-config has known severe problems:
1) It makes it hard to use libraries built by a developer with a custom --prefix. (Need to set and customize PKG_CONFIG_PATH. Lack of support for -Wl,-rpath option of the compiler.)
2) It does not work when the compiler that uses the library is different from the compiler that built the library, e.g. on Solaris.
In summary, use of pkg-config takes away freedoms from the developer.
Therefore, I'm looking for a solution that involves CMake but does not involve pkg-config.

If you try to search for an installed libunistring using the CMake command 'find_library', what does the CMake script look like, and what issues do you encounter?

Bruno Haible <haible>
Project AdministratorIn charge of this item.
Sun 22 Apr 2018 02:33:20 PM UTC, original submission:

Hi all.
I maintain a fairly large application stack that moved from
automake to cmake some time ago, and uses pkgconfig

Evidently a patch to support pkgconfig was proposed three years ago,
but the response was essentially "use autoconf, don't use pkgconfig".

I hate to break it to you, but the world no longer revolves around
autoconf, and not supporting pkgconfig makes downstream users'
lifes a bit more difficult. It might be time to consider that patch again.

Dan Kegel <dankegel>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by dankegel (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-04-22 haible CategoryBuild => Interface
        StatusNone => Need Info
        Assigned toNone => haible

    Back to the top

    Powered by Savane 3.4