summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormartind1111 <martind1111@gmail.com>2020-06-25 17:33:58 -0500
committerGitHub <noreply@github.com>2020-06-25 15:33:58 -0700
commit13d3fb2ea6036f0e12180ca64d689a7792529289 (patch)
treea7288d56178e96b3b283e14c3cbbb392324e0f15
parentd64078eb274e952056a071e74e3afce28d09e7a8 (diff)
downloadflatbuffers-13d3fb2ea6036f0e12180ca64d689a7792529289.tar.gz
flatbuffers-13d3fb2ea6036f0e12180ca64d689a7792529289.tar.bz2
flatbuffers-13d3fb2ea6036f0e12180ca64d689a7792529289.zip
Fix RPM install conflict (#6003)
-rw-r--r--CMake/PackageRedhat.cmake10
1 files changed, 10 insertions, 0 deletions
diff --git a/CMake/PackageRedhat.cmake b/CMake/PackageRedhat.cmake
index 4545e729..5b7c6fa4 100644
--- a/CMake/PackageRedhat.cmake
+++ b/CMake/PackageRedhat.cmake
@@ -31,4 +31,14 @@ if (UNIX)
set(CPACK_RPM_PACKAGE_NAME "flatbuffers")
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_RPM_PACKAGE_NAME}_${CPACK_RPM_PACKAGE_VERSION}_${CPACK_RPM_PACKAGE_ARCHITECTURE}")
+ if(NOT DEFINED ${CPACK_PACKAGING_INSTALL_PREFIX})
+ # Default packaging install prefix on RedHat systems is /usr.
+ # This is the assumed value when this variable is not defined.
+ # There is currently a conflict with
+ # /usr/${CMAKE_INSTALL_LIBDIR}/cmake which is installed by default
+ # by other packages on RedHat (most notably cmake-filesystem). Ensure
+ # that on these systems, flatbuffers does not package this path.
+ # This patch is required for cmake pre-3.17.
+ list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "/usr/${CMAKE_INSTALL_LIBDIR}/cmake")
+ endif()
endif(UNIX)