Skip to content

Commit

Permalink
BUILD(overlay): build overlay on Linux and FreeBSD without client flag
Browse files Browse the repository at this point in the history
  • Loading branch information
carlocastoldi committed Nov 29, 2022
1 parent 1424553 commit bd12091
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 44 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ option(static "Build static binaries." OFF)
option(symbols "Build binaries in a way that allows easier debugging." OFF)
option(warnings-as-errors "All warnings are treated as errors." ON)

option(client "Build the client (Mumble)" ON)
option(server "Build the server (Murmur)" ON)
if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
option(overlay "Build overlay." ON)
option(overlay "Build overlay." ${client})
endif()
option(packaging "Build package." OFF)
option(tests "Build tests." ${packaging})
Expand Down Expand Up @@ -161,7 +163,9 @@ add_compile_definitions(MUMBLE_TARGET_OS="${MUMBLE_TARGET_OS}")

set(CMAKE_UNITY_BUILD_BATCH_SIZE 40)

add_subdirectory(src)
if(client OR server)
add_subdirectory(src)
endif()

if(g15 AND WIN32)
add_subdirectory("helpers/g15helper")
Expand All @@ -174,7 +178,7 @@ if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
message(STATUS "Disabling the overlay on ARM macOS")
endif()

if(overlay AND client)
if(overlay)
if(WIN32)
add_subdirectory(overlay)
else()
Expand Down
71 changes: 34 additions & 37 deletions auxiliary_files/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,52 @@ if(NOT BUILD_RELEASE_DATE)
string(TIMESTAMP BUILD_RELEASE_DATE "%Y-%m-%d")
endif()

if(client)
if(UNIX AND NOT APPLE)
if(overlay)
if(UNIX)
delayed_configure_files(
TARGET mumble
TARGET overlay_gl
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.appdata.xml.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml"
"${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.desktop.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop"
"${CMAKE_CURRENT_SOURCE_DIR}/run_scripts/mumble-overlay.in=${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay"
PASSTHROUGH_VARIABLES
MUMBLE_BUILD_YEAR
CMAKE_PROJECT_VERSION
BUILD_RELEASE_DATE
CMAKE_PROJECT_HOMEPAGE_URL
CMAKE_PROJECT_DESCRIPTION
MUMBLE_INSTALL_ABS_LIBDIR
VARIABLES
"MUMBLE_CLIENT_BINARY_NAME=$<TARGET_FILE_NAME:mumble>"
"MUMBLE_OVERLAY_BINARY_BASENAME=$<TARGET_FILE_BASE_NAME:overlay_gl>"
PYTHON_INTERPRETER "${PYTHON_INTERPRETER}"
@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 Mumble client man files
install(FILES "man_files/mumble.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc)
# install overlay script
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay" DESTINATION "${MUMBLE_INSTALL_SCRIPTDIR}")

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

if(overlay)
if(UNIX)
delayed_configure_files(
TARGET overlay_gl
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/run_scripts/mumble-overlay.in=${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay"
PASSTHROUGH_VARIABLES
MUMBLE_BUILD_YEAR
MUMBLE_INSTALL_ABS_LIBDIR
VARIABLES
"MUMBLE_OVERLAY_BINARY_BASENAME=$<TARGET_FILE_BASE_NAME:overlay_gl>"
PYTHON_INTERPRETER "${PYTHON_INTERPRETER}"
@ONLY
)

# install overlay script
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/mumble-overlay" DESTINATION "${MUMBLE_INSTALL_SCRIPTDIR}")

# install overlay man-files
install(FILES "man_files/mumble-overlay.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc)
endif()
endif()
if(client AND UNIX AND NOT APPLE)
delayed_configure_files(
TARGET mumble
FILES
"${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.appdata.xml.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.appdata.xml"
"${CMAKE_CURRENT_SOURCE_DIR}/config_files/info.mumble.Mumble.desktop.in=${CMAKE_CURRENT_BINARY_DIR}/info.mumble.Mumble.desktop"
PASSTHROUGH_VARIABLES
MUMBLE_BUILD_YEAR
CMAKE_PROJECT_VERSION
BUILD_RELEASE_DATE
CMAKE_PROJECT_HOMEPAGE_URL
CMAKE_PROJECT_DESCRIPTION
VARIABLES
"MUMBLE_CLIENT_BINARY_NAME=$<TARGET_FILE_NAME:mumble>"
PYTHON_INTERPRETER "${PYTHON_INTERPRETER}"
@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 Mumble client man files
install(FILES "man_files/mumble.1" DESTINATION "${MUMBLE_INSTALL_MANDIR}" COMPONENT doc)
endif()

if(server)
Expand Down
2 changes: 1 addition & 1 deletion docs/dev/build-instructions/cmake_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Build support for OSS.
### overlay

Build overlay.
(Default: ON)
(Default: ${client})

### overlay-xcompile

Expand Down
3 changes: 0 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
set(PROTO_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Mumble.proto")
set(UDP_PROTO_FILE "${CMAKE_CURRENT_SOURCE_DIR}/MumbleUDP.proto")

option(client "Build the client (Mumble)" ON)
option(server "Build the server (Murmur)" ON)

option(benchmarks "Build benchmarks" OFF)

option(qssldiffiehellmanparameters "Build support for custom Diffie-Hellman parameters." ON)
Expand Down

0 comments on commit bd12091

Please sign in to comment.