From 13d3fb2ea6036f0e12180ca64d689a7792529289 Mon Sep 17 00:00:00 2001 From: martind1111 Date: Thu, 25 Jun 2020 17:33:58 -0500 Subject: [PATCH] Fix RPM install conflict (#6003) --- CMake/PackageRedhat.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMake/PackageRedhat.cmake b/CMake/PackageRedhat.cmake index 4545e7290..5b7c6fa4d 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)