This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git
The following commit(s) were added to refs/heads/main by this push:
new 6800ee7ea PROTON-2980: Correct installed pkgconfig files
6800ee7ea is described below
commit 6800ee7ea87a25f79e5406a97a6c3a1755cf4442
Author: Andrew Stitcher <[email protected]>
AuthorDate: Fri Oct 2 02:25:00 2026 -0400
PROTON-2980: Correct installed pkgconfig files
Also take this opportunity to update to using the more standard macros
available in newer versions of CMake to simplify and make the build more
conventional.
---
CMakeLists.txt | 48 +++----------------------
c/CMakeLists.txt | 72 +++++++++++++++++--------------------
c/src/libqpid-proton-core.pc.in | 6 ++--
c/src/libqpid-proton-proactor.pc.in | 6 ++--
c/src/libqpid-proton-tls.pc.in | 6 ++--
c/src/libqpid-proton.pc.in | 6 ++--
cpp/CMakeLists.txt | 25 ++++++-------
cpp/libqpid-proton-cpp.pc.in | 6 ++--
go/CMakeLists.txt | 4 +--
9 files changed, 67 insertions(+), 112 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d7d0cea92..64cdfa089 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,6 +29,7 @@ include (CheckLanguage)
include (CheckLibraryExists)
include (CheckSymbolExists)
include (CheckPythonModule)
+include (GNUInstallDirs)
find_package (OpenSSL 1.1)
find_package (Threads)
@@ -147,7 +148,6 @@ endif()
# off if building there:
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set (NOENABLE_WARNING_ERROR ON)
- set (LIB_SUFFIX "")
endif ()
# Benchmarks should be disabled by default
@@ -295,51 +295,14 @@ endif()
message(STATUS "PN_VERSION: ${PN_VERSION} (${PN_VERSION_QUALIFIER})")
-# In rpm builds the build sets some variables:
-# CMAKE_INSTALL_PREFIX - this is a standard cmake variable
-# INCLUDE_INSTALL_DIR
-# LIB_INSTALL_DIR
-# SYSCONF_INSTALL_DIR
-# SHARE_INSTALL_DIR
-# So make these cached variables and the specific variables non cached
-# and derived from them.
-
-if (NOT DEFINED LIB_SUFFIX)
- get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
- if ("${LIB64}" STREQUAL "TRUE" AND ${CMAKE_SIZEOF_VOID_P} STREQUAL "8")
- set(LIB_SUFFIX 64)
- else()
- set(LIB_SUFFIX "")
- endif()
-endif()
-
# Start of variables used during install
-set (INCLUDE_INSTALL_DIR include CACHE PATH "Include file directory")
-set (LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "Library object file
directory")
-set (SYSCONF_INSTALL_DIR etc CACHE PATH "System read only configuration
directory")
-set (SHARE_INSTALL_DIR share CACHE PATH "Shared read only data directory")
-set (MAN_INSTALL_DIR share/man CACHE PATH "Manpage directory")
-
-mark_as_advanced (INCLUDE_INSTALL_DIR LIB_INSTALL_DIR SYSCONF_INSTALL_DIR
SHARE_INSTALL_DIR MAN_INSTALL_DIR)
-
-# Sets variable NAME to contain relative path from ROOT to VALUE
-# if VALUE is already relative, it does nothing
-macro (pn_relative_install_dir NAME ROOT VALUE)
- if (IS_ABSOLUTE ${VALUE})
- file(RELATIVE_PATH "${NAME}" "${ROOT}" "${VALUE}")
- else ()
- set (${NAME} "${VALUE}")
- endif ()
-endmacro ()
-
-pn_relative_install_dir (INCLUDEDIR "${CMAKE_INSTALL_PREFIX}"
"${INCLUDE_INSTALL_DIR}")
-pn_relative_install_dir (LIBDIR "${CMAKE_INSTALL_PREFIX}" "${LIB_INSTALL_DIR}")
-## LANGUAGE BINDINGS
+set (PROTON_SHARE ${CMAKE_INSTALL_DATADIR}/proton)
-set (PROTON_SHARE ${SHARE_INSTALL_DIR}/proton)
# End of variables used during install
+## LANGUAGE BINDINGS
+
# Set result to a native search path - used by examples and binding tests.
# args after result are directories or search paths.
macro(set_search_path result)
@@ -458,6 +421,5 @@ configure_file(${PROJECT_SOURCE_DIR}/misc/config.sh.in
configure_file(${PROJECT_SOURCE_DIR}/misc/config.bat.in
${PROJECT_BINARY_DIR}/config.bat @ONLY)
-# Tests that aren't unit tests - typically they require a separate broker
process
+# Tests that aren't unit tests - typically they require a separate broker
process
add_subdirectory(tests)
-
diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt
index 976b80bae..f4f33bf8b 100644
--- a/c/CMakeLists.txt
+++ b/c/CMakeLists.txt
@@ -576,16 +576,16 @@ endif ()
install(TARGETS qpid-proton qpid-proton-core
EXPORT ProtonTargets
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (BUILD_STATIC_LIBS)
install(TARGETS qpid-proton-static qpid-proton-core-static
EXPORT ProtonTargetsStatic
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
# Install windows pdb files
@@ -602,16 +602,16 @@ if (HAS_PROACTOR)
install(TARGETS qpid-proton-proactor ${STATIC_LIBS}
EXPORT ProtonTargets
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (BUILD_STATIC_LIBS)
install(TARGETS qpid-proton-proactor-static
EXPORT ProtonTargetsStatic
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
# Install windows pdb files
@@ -627,16 +627,16 @@ if (HAS_TLS)
install(TARGETS qpid-proton-tls ${STATIC_LIBS}
EXPORT ProtonTargets
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (BUILD_STATIC_LIBS)
install(TARGETS qpid-proton-tls-static
EXPORT ProtonTargetsStatic
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
# Install windows pdb files
@@ -650,53 +650,45 @@ endif ()
# Install header files
file(GLOB headers "${CMAKE_CURRENT_BINARY_DIR}/include/proton/*.[hi]")
-install (FILES ${headers} DESTINATION ${INCLUDE_INSTALL_DIR}/proton)
+install (FILES ${headers} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/proton)
# Set ${VAR}/${VAR}DEBUG variables, configure and install the packageconf
files for LIB
-macro(configure_lib VAR LIB)
- if(DEFINED CMAKE_IMPORT_LIBRARY_PREFIX)
- set(LIB_PREFIX ${CMAKE_IMPORT_LIBRARY_PREFIX})
- set(LIB_SUFFIX ${CMAKE_IMPORT_LIBRARY_SUFFIX})
- else()
- set(LIB_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
- set(LIB_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
- endif()
- set(${VAR} ${LIB_PREFIX}${LIB}${LIB_SUFFIX})
- set("${VAR}DEBUG" ${LIB_PREFIX}${LIB}${CMAKE_DEBUG_POSTFIX}${LIB_SUFFIX})
+function(configure_lib LIB)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/lib${LIB}.pc.in
${CMAKE_CURRENT_BINARY_DIR}/lib${LIB}.pc @ONLY)
- install (FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${LIB}.pc DESTINATION
${LIB_INSTALL_DIR}/pkgconfig)
-endmacro()
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${LIB}.pc DESTINATION
${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+endfunction()
-configure_lib(PROTONLIB qpid-proton)
-configure_lib(PROTONCORELIB qpid-proton-core)
+configure_lib(qpid-proton)
+configure_lib(qpid-proton-core)
if(HAS_PROACTOR)
- configure_lib(PROTONPROACTORLIB qpid-proton-proactor)
+ configure_lib(qpid-proton-proactor)
endif(HAS_PROACTOR)
if(HAS_TLS)
- configure_lib(PROTONTLSLIB qpid-proton-tls)
+ configure_lib(qpid-proton-tls)
endif(HAS_TLS)
install(EXPORT ProtonTargets
FILE ProtonTargets.cmake
NAMESPACE Proton::
- DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Proton)
if (BUILD_STATIC_LIBS)
install(EXPORT ProtonTargetsStatic
FILE ProtonTargetsStatic.cmake
NAMESPACE Proton::
- DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Proton)
endif()
include(CMakePackageConfigHelpers)
include(WriteBasicConfigVersionFile)
+set (INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/ProtonConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ProtonConfig.cmake
PATH_VARS INCLUDE_INSTALL_DIR
- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton)
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Proton)
write_basic_config_version_file(
${CMAKE_CURRENT_BINARY_DIR}/ProtonConfigVersion.cmake
VERSION ${PN_VERSION}
@@ -704,10 +696,10 @@ write_basic_config_version_file(
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/ProtonConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/ProtonConfigVersion.cmake
- DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Proton)
install (FILES
../tools/cmake/Modules/FindCyrusSASL.cmake
- DESTINATION ${LIB_INSTALL_DIR}/cmake/Proton)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Proton)
if (ENABLE_BENCHMARKS)
add_subdirectory(benchmarks)
diff --git a/c/src/libqpid-proton-core.pc.in b/c/src/libqpid-proton-core.pc.in
index c1d3fc7da..fc5e39e15 100644
--- a/c/src/libqpid-proton-core.pc.in
+++ b/c/src/libqpid-proton-core.pc.in
@@ -17,10 +17,10 @@
* under the License.
*/
-prefix=${pcfiledir}/../..
+prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/@LIBDIR@
-includedir=${prefix}/@INCLUDEDIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: Proton Core
Description: Qpid Proton C core protocol library
diff --git a/c/src/libqpid-proton-proactor.pc.in
b/c/src/libqpid-proton-proactor.pc.in
index 4d33948f3..88c0073b5 100644
--- a/c/src/libqpid-proton-proactor.pc.in
+++ b/c/src/libqpid-proton-proactor.pc.in
@@ -17,10 +17,10 @@
* under the License.
*/
-prefix=${pcfiledir}/../..
+prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/@LIBDIR@
-includedir=${prefix}/@INCLUDEDIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: Proton Proactor
Description: Qpid Proton C proactive IO library
diff --git a/c/src/libqpid-proton-tls.pc.in b/c/src/libqpid-proton-tls.pc.in
index 932f79027..1675f2578 100644
--- a/c/src/libqpid-proton-tls.pc.in
+++ b/c/src/libqpid-proton-tls.pc.in
@@ -17,10 +17,10 @@
* under the License.
*/
-prefix=${pcfiledir}/../..
+prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/@LIBDIR@
-includedir=${prefix}/@INCLUDEDIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: Proton TLS
Description: Qpid Proton C standalone TLS library
diff --git a/c/src/libqpid-proton.pc.in b/c/src/libqpid-proton.pc.in
index 8a631246a..9e7a5232d 100644
--- a/c/src/libqpid-proton.pc.in
+++ b/c/src/libqpid-proton.pc.in
@@ -17,10 +17,10 @@
* under the License.
*/
-prefix=${pcfiledir}/../..
+prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/@LIBDIR@
-includedir=${prefix}/@INCLUDEDIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: Proton
Description: Qpid Proton C library
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 467781cf8..91763b985 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -165,16 +165,16 @@ set_target_properties (
install(TARGETS qpid-proton-cpp
EXPORT ProtonCppTargets
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
if (BUILD_STATIC_LIBS)
install(TARGETS qpid-proton-cpp-static
EXPORT ProtonCppStaticTargets
RUNTIME DESTINATION bin
- ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
- LIBRARY DESTINATION ${LIB_INSTALL_DIR}
- INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR})
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif ()
# Install windows qpid-proton-cpp pdb files
@@ -185,7 +185,7 @@ if (MSVC)
OPTIONAL)
endif (MSVC)
-install (DIRECTORY "include/proton" DESTINATION ${INCLUDE_INSTALL_DIR}
FILES_MATCHING PATTERN "*.hpp")
+install (DIRECTORY "include/proton" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
FILES_MATCHING PATTERN "*.hpp")
install (DIRECTORY "examples/"
DESTINATION "${PROTON_SHARE}/examples/cpp"
USE_SOURCE_PERMISSIONS
@@ -211,27 +211,28 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-cpp.pc @ONLY)
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/libqpid-proton-cpp.pc
- DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(EXPORT ProtonCppTargets
FILE ProtonCppTargets.cmake
NAMESPACE Proton::
- DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ProtonCpp)
if (BUILD_STATIC_LIBS)
install(EXPORT ProtonCppStaticTargets
FILE ProtonCppTargetsStatic.cmake
NAMESPACE Proton::
- DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ProtonCpp)
endif ()
include(CMakePackageConfigHelpers)
include(WriteBasicConfigVersionFile)
+set (INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR})
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/ProtonCppConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfig.cmake
PATH_VARS INCLUDE_INSTALL_DIR
- INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ProtonCpp)
write_basic_config_version_file(
${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfigVersion.cmake
VERSION ${PN_VERSION}
@@ -239,7 +240,7 @@ write_basic_config_version_file(
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/ProtonCppConfigVersion.cmake
- DESTINATION ${LIB_INSTALL_DIR}/cmake/ProtonCpp)
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ProtonCpp)
if (BUILD_TESTING)
include(tests.cmake)
diff --git a/cpp/libqpid-proton-cpp.pc.in b/cpp/libqpid-proton-cpp.pc.in
index 98012c801..ed7f193b9 100644
--- a/cpp/libqpid-proton-cpp.pc.in
+++ b/cpp/libqpid-proton-cpp.pc.in
@@ -17,10 +17,10 @@
* under the License.
*/
-prefix=${pcfiledir}/../..
+prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
-libdir=${prefix}/@LIBDIR@
-includedir=${prefix}/@INCLUDEDIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
Name: Proton C++
Description: Qpid Proton C++ library
diff --git a/go/CMakeLists.txt b/go/CMakeLists.txt
index eaaac7aa1..5be23564c 100644
--- a/go/CMakeLists.txt
+++ b/go/CMakeLists.txt
@@ -93,10 +93,10 @@ if (BUILD_GO)
endif (BUILD_EXAMPLES)
# Install go sources.
- set (GO_INSTALL_DIR ${SHARE_INSTALL_DIR}/gocode/pkg CACHE PATH "Installation
directory for Go code")
+ set (GO_INSTALL_DIR ${CMAKE_INSTALL_DATAROOTDIR}/gocode CACHE PATH
"Installation directory for Go code")
mark_as_advanced (GO_INSTALL_DIR)
- install(DIRECTORY pkg DESTINATION ${GO_INSTALL_DIR} COMPONENT Go)
+ install(DIRECTORY pkg DESTINATION ${GO_INSTALL_DIR}/src COMPONENT Go)
install(DIRECTORY examples/
DESTINATION "${PROTON_SHARE}/examples/go"
COMPONENT Go
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]