-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
44 lines (35 loc) · 1.12 KB
/
CMakeLists.txt
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
cmake_minimum_required(VERSION 3.27)
project(libmumble_protocol VERSION 0.0.1)
# Use libc++ instead of libstdc++ (Clang only)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
option(USE_LIBCPP "Use libc++ as C++ standard library" OFF)
if (USE_LIBCPP)
add_compile_options(-stdlib=libc++)
endif ()
endif ()
# Place all output binaries into the root of the build directory
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(BOOST_REQUIRED_VERSION 1.83)
include(GNUInstallDirs)
include(GenerateExportHeader)
include(CheckIPOSupported)
# check for LTO support in the compiler
check_ipo_supported(RESULT LTO_SUPPORTED)
find_package(PkgConfig REQUIRED)
option(BUILD_CLIENT "Build the client library" ON)
option(BUILD_SERVER "Build the server library" ON)
option(BUILD_TEST "Build the test executables" ON)
if (${BUILD_TEST})
enable_testing()
find_package(Catch2 3 REQUIRED)
include(CTest)
include(Catch)
endif ()
add_subdirectory(mumble_protocol)
if (${BUILD_CLIENT})
add_subdirectory(client)
endif ()
if (${BUILD_SERVER})
add_subdirectory(server)
endif ()