diff --git a/CMakeLists.txt b/CMakeLists.txt index ae3952338..725126296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,59 @@ +############################################################################ +# CMakeLists.txt +# 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 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ + cmake_minimum_required(VERSION 2.6) project(LINPHONE C) -option(LINPHONE_ENABLE_VIDEO "Build linphone with video support." ON) + +option(ENABLE_STATIC "Build static library (default is shared library)." NO) +option(ENABLE_VIDEO "Build with video support." YES) + + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_PREFIX_PATH}/share/cmake/Modules) + +include(CheckIncludeFile) + +if(MSVC) + list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_PREFIX_PATH}/include/MSVC) +endif() + +find_package(BelleSIP REQUIRED) +find_package(MS2 REQUIRED) +find_package(XML2 REQUIRED) + include_directories( include/ coreapi/ ${CMAKE_CURRENT_BINARY_DIR}/coreapi/ + ${BELLESIP_INCLUDE_DIRS} + ${MS2_INCLUDE_DIRS} + ${XML2_INCLUDE_DIRS} ) -include_directories( - ${CMAKE_INSTALL_PREFIX}/include - ${CMAKE_INSTALL_PREFIX}/include/libxml2 -) +if(MSVC) + include_directories(${CMAKE_PREFIX_PATH}/include/MSVC) +endif() + add_subdirectory(coreapi) add_subdirectory(share) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 1fb5f2add..e6f530ee9 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -1,12 +1,29 @@ +############################################################################ +# CMakeLists.txt +# 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 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ + if(MSVC) find_library(LIBGCC NAMES gcc) find_library(LIBMINGWEX NAMES mingwex) endif() -find_library(LIBORTP NAMES ortp) -find_library(LIBMEDIASTREAMER_BASE NAMES mediastreamer_base) -find_library(LIBMEDIASTREAMER_VOIP NAMES mediastreamer_voip) -find_library(LIBBELLESIP NAMES bellesip) -find_library(LIBXML2 NAMES xml2) find_program(GIT git) @@ -111,19 +128,23 @@ add_definitions( -DLINPHONE_PLUGINS_DIR="" ) -if(LINPHONE_ENABLE_VIDEO) +if(ENABLE_VIDEO) add_definitions(-DVIDEO_ENABLED) -endif(LINPHONE_ENABLE_VIDEO) +endif() +set(LIBS + ${LIBGCC} + ${LIBMINGWEX} + ${BELLESIP_LIBRARIES} + ${MS2_LIBRARIES} + ${XML2_LIBRARIES} +) if(WIN32) add_definitions( -DWINDOW_NATIVE /FIliblinphone_gitversion.h ) - -set(LIBS ws2_32) -endif(WIN32) -set(LIBS ${LIBS} ${LIBGCC} ${LIBMINGWEX} ${LIBORTP} ${LIBMEDIASTREAMER_BASE} ${LIBMEDIASTREAMER_VOIP} ${LIBBELLESIP} ${LIBXML2}) +endif() add_library(linphone SHARED ${SOURCE_FILES}) set_target_properties(linphone PROPERTIES VERSION 3.7.0 SOVERSION 5) @@ -150,4 +171,4 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/linphone.pdb PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() -endif(WIN32) +endif() diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index 8d15a6f5c..03b36a74d 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -1,17 +1,32 @@ +############################################################################ +# CMakeLists.txt +# 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 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ + install(FILES archived-rootca.pem RENAME rootca.pem - COMPONENT COMP_liblinphone DESTINATION share/linphone PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES ringback.wav - COMPONENT COMP_liblinphone DESTINATION share/sounds/linphone PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) add_subdirectory(rings) - -install(FILES ../mediastreamer2/src/voip/nowebcamCIF.jpg - COMPONENT COMP_liblinphone - DESTINATION share/images - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) diff --git a/share/rings/CMakeLists.txt b/share/rings/CMakeLists.txt index cf359bb4e..63f2c47ac 100644 --- a/share/rings/CMakeLists.txt +++ b/share/rings/CMakeLists.txt @@ -1,3 +1,25 @@ +############################################################################ +# CMakeLists.txt +# 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 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ + install(FILES oldphone.wav toy-mono.wav COMPONENT COMP_liblinphone DESTINATION share/sounds/linphone/rings