summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy W. Murphy <jeremy.william.murphy@gmail.com>2023-05-16 05:07:36 +1000
committerGitHub <noreply@github.com>2023-05-15 21:07:36 +0200
commit81c6b8823c1b58d7837e827bb1098aa5f9e5956b (patch)
treef32b43789880a8960d30e79a10217046c1ab4c01
parent4dee61c02cc777c306227cd8378767ad544ce8bf (diff)
downloadlibevent-81c6b8823c1b58d7837e827bb1098aa5f9e5956b.tar.gz
cmake: Only use relative paths for install DESTINATION option (#1405)
As described in #1404, the explicit use of CMAKE_INSTALL_PREFIX conflicts with using command-line --prefix. This simply removes all explicit use of CMAKE_INSTALL_PREFIX. Otherwise this path will be duplicated: $ cmake -DCMAKE_BUILD_TYPE=debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=inst .. $ DESTDIR=inst ninja install ... -- Installing: inst/src/le/libevent/.cmake-debug/inst/include/event2/util.h -- Installing: inst/src/le/libevent/.cmake-debug/inst/include/event2/ws.h ... Fixes: #1404 Co-authored-by: Jeremy Murphy <jeremymu@blackmagicdesign.com>
-rw-r--r--CMakeLists.txt3
-rw-r--r--cmake/AddEventLibrary.cmake4
2 files changed, 3 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab53b8b0..7199ab82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1622,8 +1622,7 @@ endif()
# Installation preparation.
#
-set(EVENT_INSTALL_CMAKE_DIR
- "${CMAKE_INSTALL_LIBDIR}/cmake/libevent")
+set(EVENT_INSTALL_CMAKE_DIR "lib/cmake/libevent")
export(PACKAGE libevent)
diff --git a/cmake/AddEventLibrary.cmake b/cmake/AddEventLibrary.cmake
index 3d53258c..ffd7e888 100644
--- a/cmake/AddEventLibrary.cmake
+++ b/cmake/AddEventLibrary.cmake
@@ -31,7 +31,7 @@ macro(generate_pkgconfig LIB_NAME)
configure_file("lib${LIB_NAME}.pc.in" "lib${LIB_NAME}.pc" @ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/lib${LIB_NAME}.pc"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
+ DESTINATION "lib/pkgconfig"
)
endmacro()
@@ -151,7 +151,7 @@ macro(add_event_library LIB_NAME)
set_target_properties(
"${LIB_NAME}_shared" PROPERTIES
OUTPUT_NAME "${LIB_NAME}-${EVENT_PACKAGE_RELEASE}.${CURRENT_MINUS_AGE}"
- INSTALL_NAME_DIR "${CMAKE_INSTALL_LIBDIR}"
+ INSTALL_NAME_DIR "lib"
LINK_FLAGS "-compatibility_version ${COMPATIBILITY_VERSION} -current_version ${COMPATIBILITY_VERSION}.${EVENT_ABI_LIBVERSION_REVISION}")
else()
math(EXPR CURRENT_MINUS_AGE "${EVENT_ABI_LIBVERSION_CURRENT}-${EVENT_ABI_LIBVERSION_AGE}")