forked from BelledonneCommunications/linphone-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
123 lines (110 loc) · 5.47 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
############################################################################
# CMakeLists.txt
# Copyright (c) 2010-2022 Belledonne Communications SARL.
#
############################################################################
#
# This file is part of Linphone SDK
# (see https://gitlab.linphone.org/BC/public/linphone-sdk).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
############################################################################
cmake_minimum_required(VERSION 3.2)
project(linphone-sdk VERSION 5.3.0 LANGUAGES NONE)
set(LINPHONESDK_DIR "${CMAKE_CURRENT_LIST_DIR}")
list(APPEND CMAKE_MODULE_PATH "${LINPHONESDK_DIR}/cmake")
include(LinphoneSdkUtils)
include(bctoolbox/cmake/BcToolboxCMakeUtils.cmake)
if(NOT LINPHONESDK_VERSION)#If LINPHONESDK_VERSION exists (ie: is in cache), then the variable has been overriden by user
bc_compute_full_version(LINPHONESDK_VERSION)
endif()
if(NOT LINPHONESDK_STATE)
bc_compute_snapshots_or_releases_state(LINPHONESDK_STATE)
endif()
if(NOT LINPHONESDK_BRANCH)
linphone_sdk_compute_git_branch(LINPHONESDK_BRANCH)
endif()
set(LINPHONESDK_VERSION_CACHED ${LINPHONESDK_VERSION} CACHE STRING "" FORCE)#Put in cache the current version : it is used to read version in cache from 'cmake -L' command
set(LINPHONESDK_PREBUILD_DEPENDENCIES)
if(ENABLE_TUNNEL)
add_custom_target(tunnel-clone
"${CMAKE_COMMAND}" "-DLINPHONESDK_DIR=${LINPHONESDK_DIR}" "-P" "${LINPHONESDK_DIR}/cmake/LinphoneSdkTunnelClone.cmake"
)
list(APPEND LINPHONESDK_PREBUILD_DEPENDENCIES tunnel-clone)
endif()
if(APPLE)
if(LINPHONESDK_PLATFORM MATCHES "Desktop")#on Apple, Desktop == Macos
set(LINPHONESDK_PLATFORM "Macos" CACHE STRING "Platform to build" FORCE)
else()
set(LINPHONESDK_PLATFORM "Macos" CACHE STRING "Platform to build")
endif()
else()
set(LINPHONESDK_PLATFORM "Desktop" CACHE STRING "Platform to build")
endif()
set_property(CACHE LINPHONESDK_PLATFORM PROPERTY STRINGS "Android" "Desktop" "IOS" "UWP" "Macos")
set(LINPHONESDK_PACKAGER "" CACHE STRING "Packager name")
set_property(CACHE LINPHONESDK_PACKAGER PROPERTY STRINGS "Nuget" "")
if(NOT LINPHONESDK_PACKAGER OR LINPHONESDK_PACKAGER STREQUAL "OFF")
if (LINPHONESDK_PLATFORM STREQUAL "Android")
include(LinphoneSdkCheckBuildToolsAndroid)
endif()
# TODO: This will be deletable once we get rid of cmake-builder
string(TOLOWER "${LINPHONESDK_PLATFORM}" _lowercase_platform)
include(cmake-builder/cmake/LinphoneOptions.cmake)
include(cmake-builder/configs/options-${_lowercase_platform}.cmake)
include(cmake-builder/options/common.cmake)
include(cmake-builder/options/bctoolbox.cmake)
include(cmake-builder/options/bzrtp.cmake)
include(cmake-builder/options/bellesip.cmake)
include(cmake-builder/options/ms2.cmake)
include(cmake-builder/options/linphone.cmake)
# Give a feature summary
include(FeatureSummary)
feature_summary(FILENAME "${CMAKE_BINARY_DIR}/enabled_features.txt" WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:")
feature_summary(FILENAME "${CMAKE_BINARY_DIR}/disabled_features.txt" WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:")
if (ENABLE_SANITIZER)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-builder/configs/config-sanitizer.cmake")
endif()
if (ENABLE_HW_SANITIZER)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake-builder/configs/config-hwsanitizer.cmake")
endif()
include(LinphoneSdkPlatform${LINPHONESDK_PLATFORM})
else()
include(LinphoneSdkPackager)
endif()
if(ENABLE_GPL_THIRD_PARTIES)
message(WARNING "
***************************************************************************
***************************************************************************
***** CAUTION, this Linphone SDK is built using third party GPL code *****
***** Even if you acquired a proprietary license from Belledonne *****
***** Communications, this SDK is GPL and GPL only. *****
***** To disable third party GPL code, set the *****
***** ENABLE_GPL_THIRD_PARTIES option to OFF *****
***************************************************************************
***************************************************************************")
else()
message("
***************************************************************************
***************************************************************************
***** Linphone SDK without third party GPL software *****
***** If you acquired a proprietary license from Belledonne *****
***** Communications, this SDK can be used to create *****
***** a proprietary Linphone-based application. *****
***************************************************************************
***************************************************************************
")
endif()