Skip to content

Commit c7270f0

Browse files
committed
Disable .pc generation by default
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.
1 parent e7e1236 commit c7270f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ if(NOT CMAKE_SKIP_INSTALL_RULES)
8787
DESTINATION "${ctre_INSTALL_CMAKEDIR}"
8888
NAMESPACE ctre::)
8989

90-
option(ctre_ENABLE_PKGCONFIG "Install a .pc file for the project" ON)
90+
option(ctre_ENABLE_PKGCONFIG "Install a .pc file for the project" OFF)
91+
mark_as_advanced(ctre_ENABLE_PKGCONFIG)
92+
9193
if(ctre_ENABLE_PKGCONFIG)
9294
# This can only detect issues on first configure, but it's still better
9395
# than nothing

0 commit comments

Comments
 (0)