-
-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Closed
Labels
Description
When running the tests for the project after building it (with -DCMAKE_INSTALL_PREFIX=/usr), the pkgconfig file is rendered with /usr/local/include instead of /usr/include.
What is the issue you have?
When building and running the tests, the CMAKE_INSTALL_PREFIX is not honored when creating the pkgconfig integration.
Please describe the steps to reproduce the issue.
cmake -DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_INSTALL_LIBDIR='/usr/lib' \
-DCMAKE_BUILD_TYPE='None' \
-DBUILD_TESTING=ON \
-DJSON_BuildTests=ON \
-DJSON_MultipleHeaders=ON \
-Wno-dev \
-B "build" \
-S .
make VERBOSE=1 -C "build"
make -k test -C "build"
make DESTDIR="${pkgdir}" install -C build
The pkgconfig integration will contain /usr/local/include, but should include /usr/include.
When building without tests, CMAKE_INSTALL_PREFIX is honored and the pkgconfig file contains /usr/include:
cmake -DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_INSTALL_LIBDIR='/usr/lib' \
-DCMAKE_BUILD_TYPE='None' \
-DJSON_MultipleHeaders=ON \
-Wno-dev \
-B "build" \
-S .
make VERBOSE=1 -C "build"
make DESTDIR="${pkgdir}" install -C build
Can you provide a small but working code example?
n/a
What is the expected behavior?
CMAKE_INSTALL_PREFIX is always honored. Tests never influence the installed files.
And what is the actual behavior instead?
CMAKE_INSTALL_PREFIX is not honored if tests are run. Running tests influences the installed files.
Which compiler and operating system are you using?
- Compiler: gcc 11.1.0
- Operating system: Arch Linux
Which version of the library did you use?
- latest release version 3.9.1
- other release - please state the version: ___
- the
developbranch
If you experience a compilation error: can you compile and run the unit tests?
- yes
- no - please copy/paste the error message below