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

Add pkg-config export to CMake script #248

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

OPNA2608
Copy link

Based on & includes #222.

Working on closing downstream issue https://gitlab.com/ubports/development/apps/lomiri-camera-app/-/issues/209.

The QMake script has code for generating a pkg-config file, which the CMake one lacks.

# pkg-config support
CONFIG += create_pc create_prl no_install_prl
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
QMAKE_PKGCONFIG_LIBDIR = ${prefix}/lib
QMAKE_PKGCONFIG_INCDIR = ${prefix}/include

This adds code to the CMake script to also generate a pkg-config file, which allows the unconditional use of pkg-config to gather flags for an installed QZXing library.

An example:

↪ cat /nix/store/i6gd51yg61b0ipfcan10q30phpkzz4bc-qzxing-3.3.0/lib/pkgconfig/QZXing.pc 
prefix=/nix/store/i6gd51yg61b0ipfcan10q30phpkzz4bc-qzxing-3.3.0
exec_prefix=${prefix}
libdir=/nix/store/i6gd51yg61b0ipfcan10q30phpkzz4bc-qzxing-3.3.0/lib
includedir=/nix/store/i6gd51yg61b0ipfcan10q30phpkzz4bc-qzxing-3.3.0/include/qzxing

Name: Qzxing
Description: Qzxing Library
Version: 3.3.0
Cflags: -DQZXING_MULTIMEDIA -DQZXING_QML -DDISABLE_LIBRARY_FEATURES -I${includedir}
Libs: -L${libdir} -lqzxing

@OPNA2608 OPNA2608 force-pushed the add/cmake-pkgconfig branch from 1e19d1c to 32b1446 Compare July 23, 2024 13:28
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.

2 participants