Commit 8f5d174f authored by Ghislain MARY's avatar Ghislain MARY

Search for gtk-mac-integration when building with CMake.

parent 8a739ac7
......@@ -126,6 +126,15 @@ if(ENABLE_GTK_UI)
message(WARNING "You need at least GTK 2.22 to enable the assistant")
set(ENABLE_ASSISTANT OFF CACHE BOOL "Turn on assistant compiling." FORCE)
endif()
if(APPLE)
find_package(GtkMacIntegration)
if(GTKMACINTEGRATION_FOUND)
set(HAVE_GTK_OSX 1)
add_definitions("${GTKMACINTEGRATION_CPPFLAGS}")
else()
message(WARNING "gtk-mac-integration not found. Please install gtk-osx-application package.")
endif()
endif()
endif()
if(ENABLE_ASSISTANT)
set(BUILD_WIZARD 1)
......
############################################################################
# FindGtkMacIntegration.txt
# Copyright (C) 2015 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 libgtkmacintegration include file and library
#
# GTKMACINTEGRATION_FOUND - system has libgtkmacintegration
# GTKMACINTEGRATION_INCLUDE_DIRS - the libgtkmacintegration include directory
# GTKMACINTEGRATION_LIBRARIES - The libraries needed to use libgtkmacintegration
# GTKMACINTEGRATION_CPPFLAGS - The cflags needed to use libgtkmacintegration
set(_GTKMACINTEGRATION_ROOT_PATHS
${CMAKE_INSTALL_PREFIX}
)
find_path(GTKMACINTEGRATION_INCLUDE_DIRS
NAMES gtkosxapplication.h
HINTS _GTKMACINTEGRATION_ROOT_PATHS
PATH_SUFFIXES include/gtkmacintegration-gtk2 include/gtkmacintegration
)
find_library(GTKMACINTEGRATION_LIBRARIES
NAMES gtkmacintegration-gtk2 gtkmacintegration
HINTS ${_GTKMACINTEGRATION_ROOT_PATHS}
PATH_SUFFIXES bin lib
)
set(GTKMACINTEGRATION_CPPFLAGS "-DMAC_INTEGRATION")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GTKMACINTEGRATION
DEFAULT_MSG
GTKMACINTEGRATION_INCLUDE_DIRS GTKMACINTEGRATION_LIBRARIES GTKMACINTEGRATION_CPPFLAGS
)
mark_as_advanced(GTKMACINTEGRATION_INCLUDE_DIRS GTKMACINTEGRATION_LIBRARIES GTKMACINTEGRATION_CPPFLAGS)
......@@ -38,6 +38,7 @@
#define PACKAGE_SOUND_DIR "${PACKAGE_SOUND_DIR}"
#cmakedefine BUILD_WIZARD
#cmakedefine HAVE_GTK_OSX
#cmakedefine HAVE_NOTIFY4
#cmakedefine HAVE_ZLIB 1
#cmakedefine HAVE_CU_GET_SUITE 1
......
......@@ -89,7 +89,6 @@ target_link_libraries(linphone-gtk linphone ${GTK2_LIBRARIES})
if(INTL_FOUND)
target_link_libraries(linphone-gtk ${INTL_LIBRARIES})
endif()
if(WIN32)
target_link_libraries(linphone-gtk Wininet)
endif()
......@@ -97,10 +96,13 @@ if(ENABLE_NOTIFY)
target_include_directories(linphone-gtk PUBLIC ${NOTIFY_INCLUDE_DIRS})
target_link_libraries(linphone-gtk ${NOTIFY_LIBRARIES})
endif()
if (HAVE_LIBUDEV_H)
if(HAVE_LIBUDEV_H)
target_link_libraries(linphone-gtk udev)
endif()
if(GTKMACINTEGRATION_FOUND)
target_include_directories(linphone-gtk ${GTKMACINTEGRATION_INCLUDE_DIRS})
target_link_libraries(linphone-gtk ${GTKMACINTEGRATION_LIBRARIES})
endif()
install(TARGETS linphone-gtk
RUNTIME DESTINATION bin
......
......@@ -80,5 +80,9 @@ else()
target_compile_definitions(liblinphone_tester PRIVATE HAVE_GTK)
target_include_directories(liblinphone_tester PUBLIC ${GTK2_INCLUDE_DIRS})
target_link_libraries(liblinphone_tester linphone ${GTK2_LIBRARIES})
if(GTKMACINTEGRATION_FOUND)
target_include_directories(linphone-gtk ${GTKMACINTEGRATION_INCLUDE_DIRS})
target_link_libraries(linphone-gtk ${GTKMACINTEGRATION_LIBRARIES})
endif()
endif()
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment