-
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
20034c8
CMake: add support for pkg-config
mwtoews c8cc329
Accommodate @rpath for test_pkg-config with CMake build
mwtoews 443219d
Use ${CMAKE_INSTALL_LIBDIR} instead of lib
mwtoews 4e2121b
Create a utility function configure_proj_pc() and use existing proj.p…
mwtoews File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -282,3 +282,24 @@ endif() | |
set(docfiles COPYING NEWS AUTHORS) | ||
install(FILES ${docfiles} | ||
DESTINATION "${DOCDIR}") | ||
|
||
################################################################################ | ||
# pkg-config support | ||
################################################################################ | ||
if(UNIX) | ||
set(SQLITE3_LIBS -lsqlite3) | ||
if(TIFF_ENABLED) | ||
set(TIFF_LIBS -ltiff) | ||
endif() | ||
if(CURL_ENABLED) | ||
set(CURL_LIBS -lcurl) | ||
endif() | ||
configure_file( | ||
${CMAKE_CURRENT_SOURCE_DIR}/cmake/proj.pc.cmake.in | ||
${CMAKE_CURRENT_BINARY_DIR}/proj.pc | ||
@ONLY) | ||
|
||
install(FILES | ||
${CMAKE_CURRENT_BINARY_DIR}/proj.pc | ||
DESTINATION lib/pkgconfig) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, |
||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
prefix=@CMAKE_INSTALL_PREFIX@ | ||
exec_prefix=${prefix} | ||
libdir=${exec_prefix}/@LIBDIR@ | ||
includedir=${prefix}/@INCLUDEDIR@ | ||
datarootdir=${prefix}/share | ||
datadir=${prefix}/@DATADIR@ | ||
|
||
Name: PROJ | ||
Description: Coordinate transformation software library | ||
Requires: | ||
Version: @PROJ_VERSION@ | ||
Libs: -L${libdir} -lproj | ||
Libs.private: @SQLITE3_LIBS@ @TIFF_LIBS@ @CURL_LIBS@ -lstdc++ | ||
Cflags: -I${includedir} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
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
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 changeProjInstallPath.cmake
.And I wouldn't delay PROJ 8.0.0 for MINGW pkgconfig.
Default config for MinGW, generator Ninja:
Looks good to me.