summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-02-21 11:34:41 +0100
committerGitHub <noreply@github.com>2020-02-21 11:34:41 +0100
commit705f4e85ba91366836a437a98a1bbf1695b779d0 (patch)
treeb5ee073706ec90e6a7e623814f22b17ae1410cb8
parentde1865fc9be14c698171c8ffdd0d5a9249efb2ea (diff)
parentfbda0575b133a57d8f5d264742098994c7624c99 (diff)
downloadlibgit2-705f4e85ba91366836a437a98a1bbf1695b779d0.tar.gz
Merge pull request #5412 from kloczek/master
Fix #5410: fix installing libgit2.pc in wrong location
-rw-r--r--cmake/Modules/PkgBuildConfig.cmake39
1 files changed, 4 insertions, 35 deletions
diff --git a/cmake/Modules/PkgBuildConfig.cmake b/cmake/Modules/PkgBuildConfig.cmake
index 1c0079eb0..e4c574431 100644
--- a/cmake/Modules/PkgBuildConfig.cmake
+++ b/cmake/Modules/PkgBuildConfig.cmake
@@ -1,10 +1,5 @@
# pkg-config file generation
#
-# Uses the following globals:
-# - PKG_BUILD_PREFIX: the build location (aka prefix). Defaults to CMAKE_INSTALL_PREFIX
-# - PKG_BUILD_LIBDIR: the libdir location. Defaults to ${prefix}/lib.
-# - PKG_BUILD_INCLUDEDIR: the includedir location. Defaults to ${prefix}/include.
-#
function(pkg_build_config)
set(options)
@@ -29,37 +24,11 @@ function(pkg_build_config)
message(FATAL_ERROR "Missing VERSION argument")
endif()
- if (DEFINED PKG_BUILD_PREFIX)
- set(PKGCONFIG_PREFIX "${PKG_BUILD_PREFIX}")
- else()
- set(PKGCONFIG_PREFIX "${CMAKE_INSTALL_PREFIX}")
- endif()
-
- if(DEFINED PKG_BUILD_LIBDIR)
- if (IS_ABSOLUTE ${PKG_BUILD_LIBDIR})
- set(PKGCONFIG_LIBDIR ${PKG_BUILD_LIBDIR})
- else()
- set(PKGCONFIG_LIBDIR "\${prefix}/${PKG_BUILD_LIBDIR}")
- endif()
- else()
- set(PKGCONFIG_LIBDIR "\${prefix}/lib")
- endif()
-
- if(DEFINED PKG_BUILD_INCLUDEDIR)
- if (IS_ABSOLUTE ${PKG_BUILD_INCLUDEDIR})
- set(PKGCONFIG_INCLUDEDIR ${PKG_BUILD_INCLUDEDIR})
- else()
- set(PKGCONFIG_INCLUDEDIR "\${prefix}/${PKG_BUILD_INCLUDEDIR}")
- endif()
- else()
- set(PKGCONFIG_INCLUDEDIR "\${prefix}/include")
- endif()
-
# Write .pc "header"
file(WRITE "${PKGCONFIG_FILE}"
- "prefix=\"${PKGCONFIG_PREFIX}\"\n"
- "libdir=\"${PKGCONFIG_LIBDIR}\"\n"
- "includedir=\"${PKGCONFIG_INCLUDEDIR}\"\n"
+ "prefix=\"${CMAKE_INSTALL_PREFIX}\"\n"
+ "libdir=\"${LIB_INSTALL_DIR}\"\n"
+ "includedir=\"${INCLUDE_INSTALL_DIR}\"\n"
"\n"
"Name: ${PKGCONFIG_NAME}\n"
"Description: ${PKGCONFIG_DESCRIPTION}\n"
@@ -105,6 +74,6 @@ function(pkg_build_config)
# Install .pc file
install(FILES "${PKGCONFIG_FILE}"
- DESTINATION "${PKGCONFIG_PREFIX}/${PKGCONFIG_LIBDIR}/pkgconfig"
+ DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
)
endfunction()