Skip to content

Commit

Permalink
Disable .pc generation by default
Browse files Browse the repository at this point in the history
The problem with generating a pkgconfig file via CMake is that it does
not fit the model of CMake. The `prefix` variable has to be absolute in
the .pc file, however CMake deals with paths relative to the prefix. The
final prefix can change at all times, via `CMAKE_INSTALL_PREFIX`,
`--prefix` parameter during install time, at CPack time and the
resulting deb/rpm files can be extracted anywhere as well. If one needs
a pkgconfig file for packaging purposes, both deb and rpm CPack
generators allow the user to add post-install scripts that can generate
it if necessary.
  • Loading branch information
friendlyanon committed Dec 4, 2021
1 parent e7e1236 commit c7270f0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ if(NOT CMAKE_SKIP_INSTALL_RULES)
DESTINATION "${ctre_INSTALL_CMAKEDIR}"
NAMESPACE ctre::)

option(ctre_ENABLE_PKGCONFIG "Install a .pc file for the project" ON)
option(ctre_ENABLE_PKGCONFIG "Install a .pc file for the project" OFF)
mark_as_advanced(ctre_ENABLE_PKGCONFIG)

if(ctre_ENABLE_PKGCONFIG)
# This can only detect issues on first configure, but it's still better
# than nothing
Expand Down

0 comments on commit c7270f0

Please sign in to comment.