Issue 2765:Added CMake support for finding gtkmacintegration so CMake works with gtk-osx-application >2.0.5_2

This commit is contained in:
DrSlony
2015-05-07 11:48:40 +02:00
parent 530ecc8356
commit 4fa2356baa
3 changed files with 37 additions and 2 deletions

View File

@@ -23,6 +23,8 @@ endif ()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/")
# Examples: "" = ~/.config/RawTherapee, "latesttag" = ~/.config/RawTherapee4.2, "_testing" = ~/.config/RawTherapee_testing # Examples: "" = ~/.config/RawTherapee, "latesttag" = ~/.config/RawTherapee4.2, "_testing" = ~/.config/RawTherapee_testing
set (CACHE_NAME_SUFFIX "" CACHE STRING "RawTherapee's cache folder suffix") set (CACHE_NAME_SUFFIX "" CACHE STRING "RawTherapee's cache folder suffix")

View File

@@ -0,0 +1,32 @@
# - Find the native GtkOSXApplication includes and library
#
# This module defines
# MACINTEGRATION_INCLUDE_DIR, where to find gtkosxapplication.h, etc.
# MACINTEGRATION_LIBRARIES, the libraries to link against to use GtkOSXApplication.
# MACINTEGRATION_FOUND, If false, do not try to use GtkOSXApplication.
# also defined, but not for general use are
# MACINTEGRATION_LIBRARY, where to find the GtkOSXApplication library.
#=============================================================================
# Copyright 2010 henrik andersson
#=============================================================================
SET(MACINTEGRATION_FIND_REQUIRED ${MacIntegration_FIND_REQUIRED})
find_path(MACINTEGRATION_INCLUDE_DIR gtkosxapplication.h PATH_SUFFIXES gtkmacintegration gtkmacintegration-gtk2)
mark_as_advanced(MACINTEGRATION_INCLUDE_DIR)
set(MACINTEGRATION_NAMES ${MACINTEGRATION_NAMES} gtkmacintegration libgtkmacintegration gtkmacintegration-gtk2 libgtkmacintegration-gtk2)
find_library(MACINTEGRATION_LIBRARY NAMES ${MACINTEGRATION_NAMES})
mark_as_advanced(MACINTEGRATION_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set MACINTEGRATION_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MACINTEGRATION DEFAULT_MSG MACINTEGRATION_LIBRARY MACINTEGRATION_INCLUDE_DIR)
IF(MACINTEGRATION_FOUND)
SET(MacIntegration_LIBRARIES ${MACINTEGRATION_LIBRARY})
SET(MacIntegration_INCLUDE_DIRS ${MACINTEGRATION_INCLUDE_DIR})
ENDIF(MACINTEGRATION_FOUND)

View File

@@ -35,9 +35,10 @@ set (BASESOURCEFILES
include_directories (BEFORE "${CMAKE_CURRENT_BINARY_DIR}") include_directories (BEFORE "${CMAKE_CURRENT_BINARY_DIR}")
if (APPLE) if (APPLE)
find_package (MacIntegration REQUIRED)
# At the time of writing Cmake has no module finder for gtkmacintegration so here we have it hard-coded, if installed via macports it should be in /opt/local/... # At the time of writing Cmake has no module finder for gtkmacintegration so here we have it hard-coded, if installed via macports it should be in /opt/local/...
set (EXTRA_LIB_RTGUI gtkmacintegration) set (EXTRA_LIB_RTGUI ${MacIntegration_LIBRARIES})
set (EXTRA_INCDIR ${EXTRA_INCDIR} /opt/local/include/gtkmacintegration) set (EXTRA_INCDIR ${EXTRA_INCDIR} ${MacIntegration_INCLUDE_DIRS})
endif (APPLE) endif (APPLE)
if (WIN32) if (WIN32)
set (EXTRA_SRC windirmonitor.cc myicon.rc) set (EXTRA_SRC windirmonitor.cc myicon.rc)