Skip to content

Commit c208343

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 9589f7c commit c208343

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
@@ -86,7 +86,9 @@ if(NOT CMAKE_SKIP_INSTALL_RULES)
8686
DESTINATION "${ctre_INSTALL_CMAKEDIR}"
8787
NAMESPACE ctre::)
8888

89-
option(ctre_ENABLE_PKGCONFIG "Install a .pc file for the project" ON)
89+
option(ctre_ENABLE_PKGCONFIG "Install a .pc file for the project" OFF)
90+
mark_as_advanced(ctre_ENABLE_PKGCONFIG)
91+
9092
if(ctre_ENABLE_PKGCONFIG)
9193
set(ctre_INSTALL_PKGCONFIG "${CMAKE_INSTALL_DATADIR}/pkgconfig/ctre.pc"
9294
CACHE FILEPATH "pkgconfig file location relative to the install prefix")

0 commit comments

Comments
 (0)