Skip to content

Commit

Permalink
Merge pull request #114 from uriparser/issue-114-cmake-absolute-libdir
Browse files Browse the repository at this point in the history
CMake: Support absolute paths for CMAKE_INSTALL_(LIB|INCLUDE)DIR
  • Loading branch information
hartwork committed Apr 7, 2021
2 parents f5682fb + 8e34b40 commit 1762d5f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,18 @@ uriparser_install(
# pkg-config file
#
if(NOT MSVC)
if(CMAKE_INSTALL_LIBDIR MATCHES "^/")
set(_URIPARSER_PKGCONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
else()
set(_URIPARSER_PKGCONFIG_LIBDIR "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
endif()

if(CMAKE_INSTALL_INCLUDEDIR MATCHES "^/")
set(_URIPARSER_PKGCONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
else()
set(_URIPARSER_PKGCONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/liburiparser.pc.in liburiparser.pc @ONLY)
uriparser_install(
FILES
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ XXXX-XX-XX -- X.X.X
* Fixed: CMake: Call "enable_language(CXX)" prior to tinkering with
CMAKE_CXX_* variables (GitHub #110)
Thanks to Alexander Richardson for the patch (originally at libexpat)
* Fixed: CMake: Support absolute paths for both CMAKE_INSTALL_LIBDIR
and CMAKE_INSTALL_INCLUDEDIR (GitHub #114)
Thanks to Rafael Fontenelle for bringing this up (originally at libexpat)
* Fixed: Windows: Address MSVC compiler warnings (GitHub #111)
* Fixed: Addressed MSVC compiler warnings in test suite code (GitHub #113)

Expand Down
1 change: 1 addition & 0 deletions THANKS
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ myd7349
Periklis Akritidis
Philip de Nier
Radu Hociung
Rafael Fontenelle
Ralf S. Engelschall
Rakesh Pandit
Ren� Rebe
Expand Down
4 changes: 2 additions & 2 deletions liburiparser.pc.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
libdir=@_URIPARSER_PKGCONFIG_LIBDIR@
includedir=@_URIPARSER_PKGCONFIG_INCLUDEDIR@

Name: liburiparser
Description: URI parsing and handling library
Expand Down

0 comments on commit 1762d5f

Please sign in to comment.