Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CMakeLists.txt « g15helper « helpers - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 38406246062ffc0efa53550ec87d4e6ea40fe6aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Copyright 2020-2022 The Mumble Developers. All rights reserved.
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file at the root of the
# Mumble source tree or at <https://www.mumble.info/LICENSE>.

option(g15-emulator "Build the g15helper executable in emulator mode. This will cause an emulated G15 window to appear on screen. Allows the use of Mumble's G15 support without owning the physical hardware." OFF)

set(G15HELPER_RC "${CMAKE_CURRENT_BINARY_DIR}/g15helper.rc")
set(G15HELPER_ICON "${CMAKE_SOURCE_DIR}/icons/g15helper.ico")
set(G15HELPER_PLIST "${CMAKE_BINARY_DIR}/g15helper.plist")

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/g15helper.plist.in" "${G15HELPER_PLIST}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/g15helper.rc.in" "${G15HELPER_RC}")

get_target_property(MUMBLE_SOURCE_DIR mumble SOURCE_DIR)

add_executable(g15-helper WIN32
	"${CMAKE_SOURCE_DIR}/auxiliary_files/mumble.appcompat.manifest"
	"${G15HELPER_RC}"
)

set_target_properties(g15-helper
	PROPERTIES
		OUTPUT_NAME "mumble-g15-helper"
		RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)

target_compile_definitions(g15-helper PRIVATE $<$<CONFIG:Debug>:USE_LOGFILE>)

if(g15-emulator)
	find_pkg(Qt5 COMPONENTS Core Gui Widgets REQUIRED)
	set_target_properties(g15-helper PROPERTIES AUTOMOC ON)
	target_sources(g15-helper PRIVATE "g15helper_emu.cpp" "g15helper_emu.h")
	target_link_libraries(g15-helper PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets)

	if(static AND WIN32 AND TARGET Qt5::QWindowsIntegrationPlugin)
		include_qt_plugin(g15-helper PRIVATE QWindowsIntegrationPlugin)
		target_link_libraries(g15-helper PRIVATE Qt5::QWindowsIntegrationPlugin)
	endif()
else()
	if(MSVC)
		set_target_properties(g15-helper PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
	endif()

	target_sources(g15-helper PRIVATE "g15helper.c" "g15helper.h")

	if(NOT G15_DIR)
		set(G15_DIR "${3RDPARTY_DIR}/g15")
	endif()

	if(64_BIT)
		find_library(LIB_LGLCD "lglcd" HINTS "${G15_DIR}/Lib/x64")
	else()
		find_library(LIB_LGLCD "lglcd" HINTS "${G15_DIR}/Lib/x86")
	endif()

	target_include_directories(g15-helper PRIVATE "${G15_DIR}/Src")

	target_link_libraries(g15-helper PRIVATE ${LIB_LGLCD})
endif()

install(TARGETS g15-helper RUNTIME DESTINATION "${MUMBLE_INSTALL_EXECUTABLEDIR}" COMPONENT mumble_client)