-
Notifications
You must be signed in to change notification settings - Fork 803
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
CMake: add support for pkg-config #2547
Conversation
661a1ea
to
20034c8
Compare
Does anyone feel qualified to review this? Nevertheless, the CMake-generated set-up passes post-install tests with Linux and macOS. One observation discovered here between autotools vs CMake installs on macOS is that the dynamic library via CMake has the relative reference |
not a cmake expert, but that looks very reasonable to me |
Given the syntax of the root |
CMakeLists.txt
Outdated
|
||
install(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/proj.pc | ||
DESTINATION lib/pkgconfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess Debian will be unhappy about this rule. Due to multi-arch, proj.pc
resides in /usr/lib/x86_64-linux-gnu/pkgconfig/
. In a GNUInstallDirs
context, the destination would probably be ${CMAKE_INSTALL_LIBDIR}/pkgconfig
.
Is everyone happy with this PR in its current state? |
CMakeLists.txt
Outdated
################################################################################ | ||
# pkg-config support | ||
################################################################################ | ||
if(UNIX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just had nothing but MinGW (MSYS2) today, and guess what... There are other pkg-config files here. I successfully tested build/install with:
if(UNIX OR MINGW)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, possibly this one too, as some of these paths are set from GNUInstallDirs
PROJ/cmake/ProjInstallPath.cmake
Lines 26 to 27 in 1a51877
if(UNIX) | |
include(GNUInstallDirs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. I don't see a difference in proj.pc
when I change ProjInstallPath.cmake
.
And I wouldn't delay PROJ 8.0.0 for MINGW pkgconfig.
Default config for MinGW, generator Ninja:
prefix=c:/OSGeo4W
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include
datarootdir=${prefix}/share
datadir=${prefix}/share/proj
Name: PROJ
Description: Coordinate transformation software library
Requires:
Version: 8.0.0
Libs: -L${libdir} -lproj
Libs.private: -lsqlite3 -ltiff -lcurl -lstdc++
Cflags: -I${includedir}
Looks good to me.
Sure, I'll give this a "go"... |
291eec4
to
4e2121b
Compare
LGTM.
|
This last update, which uses the same |
This addresses part of #2546 to install a pkg-config file.