From 1f86746a08cce543c4dce03e4e1167de29035dc9 Mon Sep 17 00:00:00 2001 From: Kenton Groombridge Date: Fri, 23 Dec 2022 15:53:28 -0500 Subject: [PATCH] BUILD(cmake): only assert install paths are relative when packaging When packaging is not enabled, do not assert that the install paths are relative. This fixes issues with live ebuilds in Gentoo. This partially reverts 703af920d8c296cdd0e0567f66d8c3e6b58521ad Signed-off-by: Kenton Groombridge --- cmake/install-paths.cmake | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/cmake/install-paths.cmake b/cmake/install-paths.cmake index 11162c91bd4..48e9651204f 100644 --- a/cmake/install-paths.cmake +++ b/cmake/install-paths.cmake @@ -62,21 +62,23 @@ set(MUMBLE_INSTALL_DOCDIR "${DOCDIR_DEFAULT}" CACHE PATH "The directory to insta set(MUMBLE_INSTALL_LICENSEDIR "${LICENSEDIR_DEFAULT}" CACHE PATH "The directory to install license files into") set(MUMBLE_INSTALL_SYSCONFDIR "${SYSCONFDIR_DEFAULT}" CACHE PATH "The directory to install system-wide config files to") -# Using absolute install paths doesn't allow CPack to create the installer for us. -# Therefore we have to make sure that the paths are indeed relative. -assert_is_relative("${MUMBLE_INSTALL_EXECUTABLEDIR}") -assert_is_relative("${MUMBLE_INSTALL_LIBDIR}") -assert_is_relative("${MUMBLE_INSTALL_PLUGINDIR}") -assert_is_relative("${MUMBLE_INSTALL_SCRIPTDIR}") -assert_is_relative("${MUMBLE_INSTALL_MANDIR}") -assert_is_relative("${MUMBLE_INSTALL_DOCDIR}") -assert_is_relative("${MUMBLE_INSTALL_LICENSEDIR}") -assert_is_relative("${MUMBLE_INSTALL_SYSCONFDIR}") +if(packaging) + # Using absolute install paths doesn't allow CPack to create the installer for us. + # Therefore we have to make sure that the paths are indeed relative. + assert_is_relative("${MUMBLE_INSTALL_EXECUTABLEDIR}") + assert_is_relative("${MUMBLE_INSTALL_LIBDIR}") + assert_is_relative("${MUMBLE_INSTALL_PLUGINDIR}") + assert_is_relative("${MUMBLE_INSTALL_SCRIPTDIR}") + assert_is_relative("${MUMBLE_INSTALL_MANDIR}") + assert_is_relative("${MUMBLE_INSTALL_DOCDIR}") + assert_is_relative("${MUMBLE_INSTALL_LICENSEDIR}") + assert_is_relative("${MUMBLE_INSTALL_SYSCONFDIR}") -if (packaging AND WIN32) - if(NOT "${MUMBLE_INSTALL_LIBDIR}" STREQUAL "${LIBDIR_DEFAULT}") - # The path has been altered which will not allow for a working installer to be created - message(FATAL_ERROR "Found non default MUMBLE_INSTALL_LIBDIR path, that will not result in a working installer! (\"${MUMBLE_INSTALL_LIBDIR}\")") + if (WIN32) + if(NOT "${MUMBLE_INSTALL_LIBDIR}" STREQUAL "${LIBDIR_DEFAULT}") + # The path has been altered which will not allow for a working installer to be created + message(FATAL_ERROR "Found non default MUMBLE_INSTALL_LIBDIR path, that will not result in a working installer! (\"${MUMBLE_INSTALL_LIBDIR}\")") + endif() endif() endif()