diff --git a/CMakeLists.txt b/CMakeLists.txt index f1664f68d1436ad0c65b5f929ff966fbeeede819..89333bde40f1b0ecc0e6047efd20234684ee0ded 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,6 +101,15 @@ if(ENABLE_NOTIFY) set(ENABLE_NOTIFY OFF CACHE BOOL "Enable libnotify support." FORCE) endif() endif() +if(ENABLE_ASSISTANT) + find_package(Soup) + if(SOUP_FOUND) + set(BUILD_WIZARD 1) + else() + message(WARNING "Could not find the soup library!") + set(ENABLE_ASSISTANT OFF CACHE BOOL "Turn on assistant compiling." FORCE) + endif() +endif() find_package(Gettext) @@ -120,6 +129,9 @@ endif() if(ENABLE_TUNNEL) include_directories(${TUNNEL_INCLUDE_DIRS}) endif() +if(ENABLE_ASSISTANT) + include_directories(${SOUP_INCLUDE_DIRS}) +endif() if(MSVC) include_directories(${CMAKE_PREFIX_PATH}/include/MSVC) diff --git a/cmake/FindNotify.cmake b/cmake/FindNotify.cmake index 26bd5bac143a9e6ddce8717bc114597060cf25b6..f77e0885fcab80240e1008d9e0e0cc6743fb82f6 100644 --- a/cmake/FindNotify.cmake +++ b/cmake/FindNotify.cmake @@ -22,9 +22,9 @@ # # - Find the notify include file and library # -# NOTIFY_FOUND - system has linphone -# NOTIFY_INCLUDE_DIRS - the linphone include directory -# NOTIFY_LIBRARIES - The libraries needed to use linphone +# NOTIFY_FOUND - system has libnotify +# NOTIFY_INCLUDE_DIRS - the libnotify include directory +# NOTIFY_LIBRARIES - The libraries needed to use libnotify set(_NOTIFY_ROOT_PATHS ${WITH_NOTIFY} diff --git a/cmake/FindSoup.cmake b/cmake/FindSoup.cmake new file mode 100644 index 0000000000000000000000000000000000000000..82735a3172ab43ca0e85e9973922176847321427 --- /dev/null +++ b/cmake/FindSoup.cmake @@ -0,0 +1,63 @@ +############################################################################ +# FindSoup.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 +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ +# +# - Find the soup include file and library +# +# SOUP_FOUND - system has libsoup +# SOUP_INCLUDE_DIRS - the libsoup include directory +# SOUP_LIBRARIES - The libraries needed to use libsoup + +find_package(GTK2 2.18 REQUIRED gtk) + +set(_SOUP_ROOT_PATHS + ${WITH_SOUP} + ${CMAKE_INSTALL_PREFIX} +) + +find_path(SOUP_INCLUDE_DIRS + NAMES libsoup/soup.h + HINTS _SOUP_ROOT_PATHS + PATH_SUFFIXES include/libsoup-2.4 +) + +if(SOUP_INCLUDE_DIRS) + set(HAVE_LIBSOUP_SOUP_H 1) + list(APPEND SOUP_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS}) +endif() + +find_library(SOUP_LIBRARIES + NAMES soup-2.4 + HINTS ${_SOUP_ROOT_PATHS} + PATH_SUFFIXES bin lib +) + +if(SOUP_LIBRARIES) + list(APPEND SOUP_LIBRARIES ${GTK2_LIBRARIES}) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Soup + DEFAULT_MSG + SOUP_INCLUDE_DIRS SOUP_LIBRARIES HAVE_LIBSOUP_SOUP_H +) + +mark_as_advanced(SOUP_INCLUDE_DIRS SOUP_LIBRARIES HAVE_LIBSOUP_SOUP_H) diff --git a/config.h.cmake b/config.h.cmake index 9690bff2712eb1acc6bcb426d89d15f9a8300c06..0d442cb3664eaa62ddd8de14a2ea8734c12b445b 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -36,6 +36,7 @@ #define PACKAGE_DATA_DIR "${PACKAGE_DATA_DIR}" #define PACKAGE_SOUND_DIR "${PACKAGE_SOUND_DIR}" +#cmakedefine BUILD_WIZARD #cmakedefine HAVE_NOTIFY4 #cmakedefine HAVE_CU_GET_SUITE 1 #cmakedefine HAVE_CU_CURSES 1 \ No newline at end of file diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 1a4f48665ec970c5cd1192053036bcd66ea331ec..541e0d6707df2b04d8b766818803d0b69d4b476b 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -97,6 +97,9 @@ if(ENABLE_TUNNEL) else() list(APPEND SOURCE_FILES linphone_tunnel_stubs.c) endif() +if(ENABLE_ASSISTANT) + list(APPEND SOURCE_FILES sipwizard.c) +endif() set(GENERATED_SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/liblinphone_gitversion.h @@ -124,6 +127,9 @@ endif() if(ENABLE_TUNNEL) list(APPEND LIBS ${TUNNEL_LIBRARIES}) endif() +if(ENABLE_ASSISTANT) + list(APPEND LIBS ${SOUP_LIBRARIES}) +endif() if(WIN32) list(APPEND LIBS shlwapi) endif() diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index 89d5805a6ce281fd8224a757594d61d501827abe..7af375971904bcb252f817ad9f4ea839ca78c861 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -65,6 +65,10 @@ set(SOURCE_FILES videowindow.c ) +if(ENABLE_ASSISTANT) + list(APPEND SOURCE_FILES setupwizard.c) +endif() + if(GETTEXT_FOUND) add_definitions("-DENABLE_NLS") endif() @@ -77,6 +81,9 @@ if(ENABLE_NOTIFY) target_include_directories(linphone-gtk PUBLIC ${NOTIFY_INCLUDE_DIRS}) target_link_libraries(linphone-gtk ${NOTIFY_LIBRARIES}) endif() +if(ENABLE_ASSISTANT) + target_link_libraries(linphone-gtk ${SOUP_LIBRARIES}) +endif() install(TARGETS linphone-gtk RUNTIME DESTINATION bin