-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (41 loc) · 1.17 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
45
46
47
48
49
50
#policies first
if(COMMAND cmake_policy)
cmake_policy(SET CMP0048 NEW)
endif()
#declare project
cmake_minimum_required(VERSION 3.10.2) #stick to 18.04 Ubuntu LTS version
project(AudioTube
VERSION 0.2.5
DESCRIPTION "Request API to get audio streams"
HOMEPAGE_URL "https://github.com/Amphaal/AudioTube"
LANGUAGES CXX
)
option(AUDIOTUBE_SHARED "Generate ${PROJECT_VERSION} as a shared library" OFF)
#cpp standards
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
###################
## Deps : spdlog ##
###################
if(NOT TARGET spdlog::spdlog)
#try to find it in packages
find_package(spdlog QUIET)
# if not found, then fetch it from source !
if(NOT spdlog_FOUND)
message("Including [spdlog] !")
Include(FetchContent)
FetchContent_Declare(spdlog
GIT_REPOSITORY "https://github.com/gabime/spdlog"
GIT_TAG "v1.x"
)
FetchContent_MakeAvailable(spdlog)
endif()
endif()
##
##
##
add_subdirectory(audiotube)
#dont build tests if included as submodule
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING)
add_subdirectory(tests)
endif()