Skip to content

Commit

Permalink
Merge PR #5992: BUILD(cmake): only assert install paths are relative …
Browse files Browse the repository at this point in the history
…when packaging
  • Loading branch information
Krzmbrzl authored Dec 26, 2022
2 parents 4f56fd8 + 1f86746 commit 4f3c289
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 4f3c289

Please sign in to comment.