Skip to content

Commit

Permalink
BUILD(cmake): only assert install paths are relative when packaging
Browse files Browse the repository at this point in the history
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 703af92

Signed-off-by: Kenton Groombridge <[email protected]>
  • Loading branch information
0xC0ncord committed Dec 24, 2022
1 parent ffeee57 commit 1f86746
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions cmake/install-paths.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 1f86746

Please sign in to comment.