config-flexisip.cmake 3.95 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
############################################################################
# config-flexisip.cmake
# Copyright (C) 2014  Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
19
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 21 22
#
############################################################################

Ghislain MARY's avatar
Ghislain MARY committed
23
# Define default values for the flexisip builder options
24 25
set(DEFAULT_VALUE_ENABLE_ADVANCED_IM ON)
set(DEFAULT_VALUE_ENABLE_DB_STORAGE ON)
Ghislain MARY's avatar
Ghislain MARY committed
26
set(DEFAULT_VALUE_ENABLE_REDIS ON)
27
set(DEFAULT_VALUE_ENABLE_UNIT_TESTS ON)
28 29 30 31 32
set(DEFAULT_VALUE_ENABLE_PRESENCE ON)
set(DEFAULT_VALUE_ENABLE_CONFERENCE ON)
set(DEFAULT_VALUE_ENABLE_SNMP OFF)
set(DEFAULT_VALUE_ENABLE_POLARSSL OFF)
set(DEFAULT_VALUE_ENABLE_MBEDTLS ON)
33
set(DEFAULT_VALUE_ENABLE_PROTOBUF OFF)
34 35 36
set(DEFAULT_VALUE_ENABLE_JWE_AUTH_PLUGIN ON)
set(DEFAULT_VAULE_ENABLE_EXTERNAL_AUTH_PLUGIN ON)
set(DEFAULT_VALUE_ENABLE_TRANSCODER ON)
37
set(DEFAULT_VALUE_ENABLE_SOCI ON)
Ghislain MARY's avatar
Ghislain MARY committed
38

39
set(DEFAULT_VALUE_ENABLE_VCARD OFF)
40 41
set(DEFAULT_VALUE_ENABLE_VIDEO OFF)

Ghislain MARY's avatar
Ghislain MARY committed
42
set(DEFAULT_VALUE_CMAKE_LINKING_TYPE "-DENABLE_STATIC=NO")
43

44 45 46
# ms2 default values
set(DEFAULT_VALUE_ENABLE_SPEEX ON)

47 48
# Global configuration
set(LINPHONE_BUILDER_HOST "")
49
set(USE_SYSTEM_XSD YES)
50 51 52 53 54 55 56

# Adjust PKG_CONFIG_PATH to include install directory
if(UNIX)
	set(LINPHONE_BUILDER_PKG_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/:$ENV{PKG_CONFIG_PATH}:/usr/lib/pkgconfig/:/usr/lib/x86_64-linux-gnu/pkgconfig/:/usr/share/pkgconfig/:/usr/local/lib/pkgconfig/:/opt/local/lib/pkgconfig/")
else() # Windows
	set(LINPHONE_BUILDER_PKG_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/")
endif()
jehan's avatar
jehan committed
57
if(APPLE)
58 59 60 61 62 63 64 65 66
	if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) #is it still useful?
		#without instruction chose to target lower version between current machine and current used SDK
		execute_process(COMMAND sw_vers -productVersion  COMMAND awk -F \\. "{printf \"%i.%i\",$1,$2}"  RESULT_VARIABLE sw_vers_version OUTPUT_VARIABLE CURRENT_OSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
		execute_process(COMMAND xcrun --sdk macosx --show-sdk-version RESULT_VARIABLE xcrun_sdk_version OUTPUT_VARIABLE CURRENT_SDK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
		if (${CURRENT_OSX_VERSION} VERSION_LESS ${CURRENT_SDK_VERSION})
			set(CMAKE_OSX_DEPLOYMENT_TARGET ${CURRENT_OSX_VERSION})
		else()
			set(CMAKE_OSX_DEPLOYMENT_TARGET ${CURRENT_SDK_VERSION})
		endif()
jehan's avatar
jehan committed
67 68 69
	endif()
	set(CMAKE_MACOSX_RPATH 1)
endif()
70

71 72 73 74 75 76 77 78 79
include(GNUInstallDirs)
if(NOT CMAKE_INSTALL_RPATH)
	list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" _IS_SYSTEM_DIR)
	if(_IS_SYSTEM_DIR STREQUAL "-1")
		set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
		if(NOT CMAKE_INSTALL_LIBDIR STREQUAL "lib")
			list(APPEND CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
		endif()
	endif()
jehan's avatar
jehan committed
80 81
endif()
message("cmake install rpath: ${CMAKE_INSTALL_RPATH}")
82

83 84 85
# Include builders
include(builders/CMakeLists.txt)

86
# bctoolbox
87
lcb_builder_cmake_options(bctoolbox "-DENABLE_TESTS_COMPONENT=${ENABLE_UNIT_TESTS}")
88

89 90 91 92 93
# linphone
lcb_builder_cmake_options(linphone
	"-DENABLE_CONSOLE_UI=NO"
	"-DENABLE_DAEMON=NO"
)
94 95 96 97
if(ENABLE_CONFERENCE)
	lcb_builder_cmake_options(linphone
		"-DENABLE_CXX_WRAPPER=YES"
		"-DENABLE_SOCI=YES"
98
		"-DENABLE_UNIT_TESTS=${ENABLE_UNIT_TESTS}"
99 100
	)
endif()
Ghislain MARY's avatar
Ghislain MARY committed
101 102

# soci
103
lcb_builder_cmake_options(soci "-DWITH_MYSQL=ON" "-DSOCI_FRAMEWORK=OFF")