Skip to content

Commit

Permalink
Merge PR #6100: BUILD(cmake): Improve install handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzmbrzl authored Jan 1, 2024
2 parents 7bc05b3 + 6925837 commit 96f2581
Show file tree
Hide file tree
Showing 9 changed files with 140 additions and 77 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ endif()
# Get compilation year
string(TIMESTAMP MUMBLE_BUILD_YEAR "%Y")

project(Mumble
project(mumble
VERSION "1.6.${BUILD_NUMBER}"
DESCRIPTION "Open source, low-latency, high quality voice chat."
HOMEPAGE_URL "https://www.mumble.info"
Expand Down
46 changes: 14 additions & 32 deletions auxiliary_files/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,46 +52,23 @@ if(client AND UNIX AND NOT APPLE)
@ONLY
)

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml" DESTINATION "${MUMBLE_INSTALL_METADATADIR}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop" DESTINATION "${MUMBLE_INSTALL_APPLICATIONSDIR}")

# Install Mumble client man files
install(FILES "man_files/mumble.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc)
endif()

if(server)
file(COPY "mumble-server.ini" DESTINATION ${CMAKE_BINARY_DIR})
file(COPY "config_files/mumble-server.conf" DESTINATION ${CMAKE_CURRENT_BINARY_DIR})

# systemd related files
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
get_pkgconf_variable(
OUTPUT_VARIABLE SYSUSERS_DIR
MODULE systemd
VARIABLE_NAME sysusersdir
QUIET
)
if(NOT SYSUSERS_DIR)
# Fallback value, in case it could not be fetched via pkg-config
set(SYSUSERS_DIR "${CMAKE_INSTALL_SYSCONFDIR}/sysconfig.d")
endif()
get_pkgconf_variable(
OUTPUT_VARIABLE SYSTEMD_SERVICE_DIR
MODULE systemd
VARIABLE_NAME systemd_system_unit_dir
QUIET
)
if(NOT SYSTEMD_SERVICE_DIR)
# Default to /etc/systemd/system - This is not where packages ought to install their service files (rather
# it's where an admin is supposed to add their system files), but this seems to be the most consistent
# path across different platforms, so we use it anyway.
set(SYSTEMD_SERVICE_DIR "${CMAKE_INSTALL_SYSCONFDIR}/systemd/system")
endif()

delayed_configure_files(
TARGET mumble-server
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/config_files/mumble-server.service.in=${CMAKE_CURRENT_BINARY_DIR}/mumble-server.service"
"${CMAKE_CURRENT_SOURCE_DIR}/config_files/mumble-server.tmpfiles.in=${CMAKE_CURRENT_BINARY_DIR}/mumble-server.tmpfiles"
"${CMAKE_CURRENT_SOURCE_DIR}/run_scripts/mumble-server-user-wrapper.in=${CMAKE_CURRENT_BINARY_DIR}/mumble-server-user-wrapper"
PASSTHROUGH_VARIABLES
MUMBLE_BUILD_YEAR
Expand All @@ -105,20 +82,25 @@ if(server)

install(FILES "man_files/mumble-server-user-wrapper.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc)

install(FILES "config_files/mumble-server.sysusers" DESTINATION "${SYSUSERS_DIR}" COMPONENT mumble_server RENAME "mumble-server.conf")
install(FILES "config_files/mumble-server.sysusers" DESTINATION "${MUMBLE_INSTALL_SYSUSERSDIR}" COMPONENT mumble_server RENAME "mumble-server.conf")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mumble-server.tmpfiles" DESTINATION "${MUMBLE_INSTALL_TMPFILESDIR}" COMPONENT mumble_server RENAME "mumble-server.conf")

install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mumble-server.service" DESTINATION "${SYSTEMD_SERVICE_DIR}" COMPONENT mumble_server)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mumble-server-user-wrapper" DESTINATION "${MUMBLE_INSTALL_EXECUTABLEDIR}" COMPONENT mumble_server)
install(FILES "config_files/mumble-server.conf" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/system.d" COMPONENT mumble_server)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/mumble-server.service" DESTINATION "${MUMBLE_INSTALL_SERVICEFILEDIR}" COMPONENT mumble_server)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/mumble-server-user-wrapper" DESTINATION "${MUMBLE_INSTALL_EXECUTABLEDIR}" COMPONENT mumble_server
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()

if(UNIX AND NOT APPLE)
install(FILES "man_files/mumble-server.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc)

install(FILES "mumble-server.ini" DESTINATION "${MUMBLE_INSTALL_SYSCONFDIR}" COMPONENT mumble_server)
install(
FILES "mumble-server.ini" DESTINATION "${MUMBLE_INSTALL_SYSCONFDIR}" COMPONENT mumble_server
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ
)

if(ice)
install(FILES "${CMAKE_SOURCE_DIR}/src/murmur/MumbleServer.ice" DESTINATION "${MUMBLE_INSTALL_SYSCONFDIR}" COMPONENT mumble_server)
install(FILES "${CMAKE_SOURCE_DIR}/src/murmur/MumbleServer.ice" DESTINATION "${MUMBLE_INSTALL_SERVER_SHAREDIR}" COMPONENT mumble_server)
endif()
endif()
endif()
Expand Down
12 changes: 0 additions & 12 deletions auxiliary_files/config_files/mumble-server.conf

This file was deleted.

6 changes: 6 additions & 0 deletions auxiliary_files/config_files/mumble-server.tmpfiles.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# When this file is processed by systemd-tmpfiles, it will change the group-ownership
# of the installed Mumble server ini file to _mumble-server to make it readable for the
# special user used to execute the Mumble server when started via systemd

# Type # Path # Mode # User # Group
z @MUMBLE_INSTALL_ABS_SYSCONFDIR@/mumble-server.ini 0640 root _mumble-server
8 changes: 4 additions & 4 deletions auxiliary_files/run_scripts/mumble-server-user-wrapper.in
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ done
DBUSFILE=$DIR/.dbus.sh

if [ $DO_KILL == 1 ]; then
if pkill -U $UID -u $EUID -o -x -f "/usr/sbin/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini"; then
if pkill -U $UID -u $EUID -o -x -f "@MUMBLE_INSTALL_ABS_EXECUTABLEDIR@/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini"; then
echo "Termination signal sent"
else
echo "Mumble server process not found; not terminated"
Expand Down Expand Up @@ -82,11 +82,11 @@ fi

if [ "X$SETPW" != "X" ]; then
echo "Setting superuser password to \"$SETPW\""
/usr/sbin/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini -supw $SETPW
@MUMBLE_INSTALL_ABS_EXECUTABLEDIR@/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini -supw $SETPW
exit 0
fi

PID=$(pgrep -U $UID -u $EUID -o -x -f "/usr/sbin/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini")
PID=$(pgrep -U $UID -u $EUID -o -x -f "@MUMBLE_INSTALL_ABS_EXECUTABLEDIR@/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini")

if [ $DO_STATUS == 1 ]; then
if [ "X$PID" != "X" ]; then
Expand Down Expand Up @@ -117,4 +117,4 @@ if ! dbus-send --print-reply --dest=org.freedesktop.DBus --type=method_call / or
fi

echo "Starting Mumble server"
exec /usr/sbin/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini
exec @MUMBLE_INSTALL_ABS_EXECUTABLEDIR@/@MUMBLE_SERVER_BINARY_NAME@ -ini $DIR/mumble-server.ini
127 changes: 102 additions & 25 deletions cmake/install-paths.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
# Mumble source tree or at <https://www.mumble.info/LICENSE>.

include(GNUInstallDirs)
include(pkg-utils)

option(use-pkgconf-install-paths "Try to query install paths from pkgconf - this is incompatible to using CMAKE_INSTALL_PREFIX" OFF)

# Turns a path into an absolute path if it isn't absolute already
function(make_absolute out_path in_path)
Expand All @@ -19,27 +22,66 @@ function(assert_is_relative path)
endif()
endfunction()

function(pkgconf_install_path outputVariable module variable default)
find_package(PkgConfig)

if(NOT PkgConfig_FOUND)
# Immediately use the default and return
set(${outputVariable} "${default}" PARENT_SCOPE)
return()
endif()

get_pkgconf_variable(
OUTPUT_VARIABLE PKGCONF_PATH
MODULE ${module}
VARIABLE_NAME ${variable}
)

if(NOT PKGCONF_PATH)
set(${outputVariable} "${default}" PARENT_SCOPE)
message(WARNING "Using fallback install path for ${outputVariable}: '${default}'")
else()
if(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
# The paths returned by pkgconf are always absolute, which breaks cmake's system using
# CMAKE_INSTALL_PREFIX to determine where file should be installed to.
message(WARNING "Install paths determined by pkgconf are unaffected by CMAKE_INSTALL_PREFIX - current path: ${PKGCONF_PATH}")
endif()

set(${outputVariable} "${PKGCONF_PATH}" PARENT_SCOPE)
endif()
endfunction()


if(UNIX)
if(APPLE)
set(EXECUTABLEDIR_DEFAULT ".")
set(LIBDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/mumble")
set(PLUGINDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/mumble/plugins")
set(SCRIPTDIR_DEFAULT "${CMAKE_INSTALL_BINDIR}")
set(MANDIR_DEFAULT "${CMAKE_INSTALL_MANDIR}/man1")
set(DOCDIR_DEFAULT "${CMAKE_INSTALL_DOCDIR}")
set(LICENSEDIR_DEFAULT "${EXECUTABLEDIR_DEFAULT}/licenses")
set(SYSCONFDIR_DEFAULT "${CMAKE_INSTALL_SYSCONFDIR}/mumble")
set(SERVICEFILEDIR_DEFAULT "./services/")
set(SYSUSERSDIR_DEFAULT "./sysusers/")
set(TMPFILESDIR_DEFAULT "./tmpfiles/")
else()
set(EXECUTABLEDIR_DEFAULT "bin")
set(LIBDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/mumble")
set(PLUGINDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/mumble/plugins")
set(SCRIPTDIR_DEFAULT "${CMAKE_INSTALL_BINDIR}")
set(MANDIR_DEFAULT "${CMAKE_INSTALL_MANDIR}/man1")
set(DOCDIR_DEFAULT "${CMAKE_INSTALL_DOCDIR}")
set(LICENSEDIR_DEFAULT "${EXECUTABLEDIR_DEFAULT}/licenses")
set(SYSCONFDIR_DEFAULT "${CMAKE_INSTALL_SYSCONFDIR}/mumble")
set(EXECUTABLEDIR_DEFAULT "${CMAKE_INSTALL_BINDIR}")
if (use-pkgconf-install-paths)
pkgconf_install_path(SERVICEFILEDIR_DEFAULT systemd systemd_system_unit_dir "${CMAKE_INSTALL_SYSCONFDIR}/systemd/system/")
pkgconf_install_path(SYSUSERSDIR_DEFAULT systemd sysusers_dir "${CMAKE_INSTALL_SYSCONFDIR}/sysusers.d")
pkgconf_install_path(TMPFILESDIR_DEFAULT systemd tmpfiles_dir "${CMAKE_INSTALL_SYSCONFDIR}/tmpfiles.d")
else()
set(SERVICEFILEDIR_DEFAULT "${CMAKE_INSTALL_SYSCONFDIR}/systemd/system/")
set(SYSUSERSDIR_DEFAULT "${CMAKE_INSTALL_SYSCONFDIR}/sysusers.d")
set(TMPFILESDIR_DEFAULT "${CMAKE_INSTALL_SYSCONFDIR}/tmpfiles.d")
endif()
endif()

set(LIBDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/mumble")
set(PLUGINDIR_DEFAULT "${CMAKE_INSTALL_LIBDIR}/mumble/plugins")
set(SCRIPTDIR_DEFAULT "${CMAKE_INSTALL_BINDIR}")
set(MANDIR_DEFAULT "${CMAKE_INSTALL_MANDIR}/man1")
set(DOCDIR_DEFAULT "${CMAKE_INSTALL_DOCDIR}")
set(LICENSEDIR_DEFAULT "${DOCDIR_DEFAULT}")
set(SYSCONFDIR_DEFAULT "${CMAKE_INSTALL_SYSCONFDIR}/mumble")
set(METADATADIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
set(APPLICATIONSDIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/applications")
set(CLIENT_SHAREDIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/mumble")
set(SERVER_SHAREDIR_DEFAULT "${CMAKE_INSTALL_DATAROOTDIR}/mumble-server")
else()
set(EXECUTABLEDIR_DEFAULT ".")
# In order for the installer to produce a working version of Mumble, this
Expand All @@ -49,8 +91,15 @@ else()
set(SCRIPTDIR_DEFAULT "./scripts")
set(MANDIR_DEFAULT "./man1")
set(DOCDIR_DEFAULT "./docs")
set(LICENSEDIR_DEFAULT "${EXECUTABLEDIR_DEFAULT}/licenses")
set(LICENSEDIR_DEFAULT "${DOCDIR_DEFAULT}")
set(SYSCONFDIR_DEFAULT "${CMAKE_INSTALL_SYSCONFDIR}/mumble")
set(METADATADIR_DEFAULT "./metainfo")
set(APPLICATIONSDIR_DEFAULT "./applications")
set(SERVICEFILEDIR_DEFAULT "./services/")
set(SYSUSERSDIR_DEFAULT "./sysusers/")
set(TMPFILESDIR_DEFAULT "./tmpfiles/")
set(CLIENT_SHAREDIR_DEFAULT "./share/mumble")
set(SERVER_SHAREDIR_DEFAULT "./share/mumble-server")
endif()

set(MUMBLE_INSTALL_EXECUTABLEDIR "${EXECUTABLEDIR_DEFAULT}" CACHE PATH "The directory to install the main executable(s) into")
Expand All @@ -61,6 +110,13 @@ set(MUMBLE_INSTALL_MANDIR "${MANDIR_DEFAULT}" CACHE PATH "The directory to insta
set(MUMBLE_INSTALL_DOCDIR "${DOCDIR_DEFAULT}" CACHE PATH "The directory to install documentation files into")
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")
set(MUMBLE_INSTALL_METADATADIR "${METADATADIR_DEFAULT}" CACHE PATH "The directory to install metadata files files to")
set(MUMBLE_INSTALL_APPLICATIONSDIR "${APPLICATIONSDIR_DEFAULT}" CACHE PATH "The directory to install application files files to")
set(MUMBLE_INSTALL_SERVICEFILEDIR "${SERVICEFILEDIR_DEFAULT}" CACHE PATH "The directory to install systemd service files to")
set(MUMBLE_INSTALL_SYSUSERSDIR "${SYSUSERSDIR_DEFAULT}" CACHE PATH "The directory to install systemd sysusers files to")
set(MUMBLE_INSTALL_TMPFILESDIR "${TMPFILESDIR_DEFAULT}" CACHE PATH "The directory to install systemd tmpfiles files to")
set(MUMBLE_INSTALL_CLIENT_SHAREDIR "${CLIENT_SHAREDIR_DEFAULT}" CACHE PATH "The directory to install miscellaneous client files to")
set(MUMBLE_INSTALL_SERVER_SHAREDIR "${SERVER_SHAREDIR_DEFAULT}" CACHE PATH "The directory to install miscellaneous server files to")

if(packaging)
# Using absolute install paths doesn't allow CPack to create the installer for us.
Expand All @@ -73,6 +129,13 @@ if(packaging)
assert_is_relative("${MUMBLE_INSTALL_DOCDIR}")
assert_is_relative("${MUMBLE_INSTALL_LICENSEDIR}")
assert_is_relative("${MUMBLE_INSTALL_SYSCONFDIR}")
assert_is_relative("${MUMBLE_INSTALL_METADATADIR}")
assert_is_relative("${MUMBLE_INSTALL_APPLICATIONSDIR}")
assert_is_relative("${MUMBLE_INSTALL_SERVICEFILEDIR}")
assert_is_relative("${MUMBLE_INSTALL_SYSUSERSDIR}")
assert_is_relative("${MUMBLE_INSTALL_TMPFILESDIR}")
assert_is_relative("${MUMBLE_INSTALL_CLIENT_SHAREDIR}")
assert_is_relative("${MUMBLE_INSTALL_SERVER_SHAREDIR}")

if (WIN32)
if(NOT "${MUMBLE_INSTALL_LIBDIR}" STREQUAL "${LIBDIR_DEFAULT}")
Expand All @@ -92,20 +155,34 @@ make_absolute(MUMBLE_INSTALL_ABS_MANDIR "${MUMBLE_INSTALL_MANDIR}")
make_absolute(MUMBLE_INSTALL_ABS_DOCDIR "${MUMBLE_INSTALL_DOCDIR}")
make_absolute(MUMBLE_INSTALL_ABS_LICENSEDIR "${MUMBLE_INSTALL_LICENSEDIR}")
make_absolute(MUMBLE_INSTALL_ABS_SYSCONFDIR "${MUMBLE_INSTALL_SYSCONFDIR}")
make_absolute(MUMBLE_INSTALL_ABS_METADATADIR "${MUMBLE_INSTALL_METADATADIR}")
make_absolute(MUMBLE_INSTALL_ABS_APPLICATIONSDIR "${MUMBLE_INSTALL_APPLICATIONSDIR}")
make_absolute(MUMBLE_INSTALL_ABS_SERVICEFILEDIR "${MUMBLE_INSTALL_SERVICEFILEDIR}")
make_absolute(MUMBLE_INSTALL_ABS_SYSUSERSDIR "${MUMBLE_INSTALL_SYSUSERSDIR}")
make_absolute(MUMBLE_INSTALL_ABS_TMPFILESDIR "${MUMBLE_INSTALL_TMPFILESDIR}")
make_absolute(MUMBLE_INSTALL_ABS_CLIENT_SHAREDIR "${MUMBLE_INSTALL_CLIENT_SHAREDIR}")
make_absolute(MUMBLE_INSTALL_ABS_SERVER_SHAREDIR "${MUMBLE_INSTALL_SERVER_SHAREDIR}")

option(display-install-paths OFF)
option(display-install-paths "Print out base install paths during project configuration" OFF)

if(display-install-paths)
message(STATUS "")
message(STATUS "These are the paths the different components will be installed to:")
message(STATUS "Executables: \"${MUMBLE_INSTALL_ABS_EXECUTABLEDIR}\"")
message(STATUS "Libraries: \"${MUMBLE_INSTALL_ABS_LIBDIR}\"")
message(STATUS "Plugins: \"${MUMBLE_INSTALL_ABS_PLUGINDIR}\"")
message(STATUS "Scripts: \"${MUMBLE_INSTALL_ABS_SCRIPTDIR}\"")
message(STATUS "Man-files: \"${MUMBLE_INSTALL_ABS_MANDIR}\"")
message(STATUS "Documentation: \"${MUMBLE_INSTALL_ABS_DOCDIR}\"")
message(STATUS "Licenses: \"${MUMBLE_INSTALL_ABS_LICENSEDIR}\"")
message(STATUS "Config files: \"${MUMBLE_INSTALL_ABS_SYSCONFDIR}\"")
message(STATUS "Executables: \"${MUMBLE_INSTALL_ABS_EXECUTABLEDIR}\"")
message(STATUS "Libraries: \"${MUMBLE_INSTALL_ABS_LIBDIR}\"")
message(STATUS "Plugins: \"${MUMBLE_INSTALL_ABS_PLUGINDIR}\"")
message(STATUS "Scripts: \"${MUMBLE_INSTALL_ABS_SCRIPTDIR}\"")
message(STATUS "Man-files: \"${MUMBLE_INSTALL_ABS_MANDIR}\"")
message(STATUS "Documentation: \"${MUMBLE_INSTALL_ABS_DOCDIR}\"")
message(STATUS "Licenses: \"${MUMBLE_INSTALL_ABS_LICENSEDIR}\"")
message(STATUS "Config files: \"${MUMBLE_INSTALL_ABS_SYSCONFDIR}\"")
message(STATUS "Metadata files: \"${MUMBLE_INSTALL_ABS_METADATADIR}\"")
message(STATUS "Application files: \"${MUMBLE_INSTALL_ABS_APPLICATIONSDIR}\"")
message(STATUS "Service files: \"${MUMBLE_INSTALL_ABS_SERVICEFILEDIR}\"")
message(STATUS "Sysusers files: \"${MUMBLE_INSTALL_ABS_SYSUSERSDIR}\"")
message(STATUS "Tmpfiles files: \"${MUMBLE_INSTALL_ABS_TMPFILESDIR}\"")
message(STATUS "Shared client files: \"${MUMBLE_INSTALL_ABS_CLIENT_SHAREDIR}\"")
message(STATUS "Shared server files: \"${MUMBLE_INSTALL_ABS_SERVER_SHAREDIR}\"")
message(STATUS "")
endif()

4 changes: 2 additions & 2 deletions cmake/pkg-utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ function(get_pkgconf_variable)
message(FATAL_ERROR "get_pkgconf_variable: pkg-config was not found - can't use it to fetch variables")
endif()

pkg_search_module("${GET_PKGCONF_VAR_MODULE}" QUIET)
if(NOT ${GET_PKGCONF_VAR_MODULE}_FOUND)
pkg_search_module("PKGCONF_MODULE" "${GET_PKGCONF_VAR_MODULE}" QUIET)
if(NOT PKGCONF_MODULE_FOUND)
if(GET_PKGCONF_VAR_DEBUG)
message(STATUS "Unable to find module \"${GET_PKGCONF_VAR_MODULE}\" via pkg-conf")
set(VAR_VALUE "NOTFOUND")
Expand Down
10 changes: 10 additions & 0 deletions docs/dev/build-instructions/cmake_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ Include support for reporting crashes to the Mumble developers.
Prints extended information during the search for the needed dependencies
(Default: OFF)

### display-install-paths

Print out base install paths during project configuration
(Default: OFF)

### elevation

Set \"uiAccess=true\", required for global shortcuts to work with privileged applications. Requires the client's executable to be signed with a trusted code signing certificate.
Expand Down Expand Up @@ -234,6 +239,11 @@ Include languages other than English.
Check for updates by default.
(Default: ON)

### use-pkgconf-install-paths

Try to query install paths from pkgconf - this is incompatible to using CMAKE_INSTALL_PREFIX
(Default: OFF)

### warnings-as-errors

All warnings are treated as errors.
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate_cmake_options_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def main():
for currentFile in cmakeFiles:
content = open(currentFile, "r").read()

pattern = re.compile("option\(([a-zA-Z_\-0-9]+)\s+\"(.*?)\"\s+(.*?)\)")
pattern = re.compile(r"option\(([a-zA-Z_\-0-9]+)\s+\"(.*?)\"\s+(.*?)\)")
pos = 0
match = pattern.search(content, pos)

Expand Down

0 comments on commit 96f2581

Please sign in to comment.