blob: 239cb1b07bbd7b87fcabe1d973e901762855238d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# - Try to find GTK3
#
# $Id$
#
# Once done this will define
#
# GTK3_FOUND - System has GTK3
# GTK3_INCLUDE_DIRS - The GTK3 include directory
# GTK3_LIBRARIES - The libraries needed to use GTK3
# GTK3_DEFINITIONS - Compiler switches required for using GTK3
#=============================================================================
# Copyright 2011 Duncan Mac-Vicar P. <duncan@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(FindWSWinLibs)
FindWSWinLibs("gtk3" "GTK3_HINTS")
if(DEFINED GTK3_HINTS)
if (DEFINED ENV{PKG_CONFIG_PATH})
set( ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:{GTK3_HINTS}/lib/pkgconfig" )
else()
set( ENV{PKG_CONFIG_PATH} "${GTK3_HINTS}/lib/pkgconfig" )
endif()
endif()
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
FIND_PACKAGE(PkgConfig)
PKG_CHECK_MODULES(PC_GTK3 gtk+-3.0 QUIET)
# MESSAGE(STATUS "PC_GTK3_INCLUDEDIR: ${PC_GTK3_INCLUDEDIR}")
# MESSAGE(STATUS "PC_GTK3_INCLUDE_DIRS: ${PC_GTK3_INCLUDE_DIRS}")
# MESSAGE(STATUS "PC_GTK3_LIBRARIES: ${PC_GTK3_LIBRARIES}")
# MESSAGE(STATUS "PC_GTK3_LIBRARY_DIRS: ${PC_GTK3_LIBRARY_DIRS}")
# MESSAGE(STATUS "PC_GTK3_LDFLAGS: ${PC_GTK3_LDFLAGS}")
# MESSAGE(STATUS "PC_GTK3_LDFLAGS_OTHER: ${PC_GTK3_LDFLAGS_OTHER}")
SET(GTK3_DEFINITIONS ${PC_GTK3_CFLAGS_OTHER})
if( NOT PC_GTK3_FOUND )
FIND_PATH(GTK3_INCLUDE_DIR
NAMES
"gtk/gtk.h"
HINTS
${GTK3_HINTS}/include
${PC_GTK3_INCLUDEDIR}
${PC_GTK3_INCLUDE_DIRS}
PATH_SUFFIXES
"gtk-3.0"
)
FIND_LIBRARY(GTK3_LIBRARY
NAMES
gtk-3 gtk3
HINTS
${GTK3_HINTS}/lib
${PC_GTK3_LIBDIR}
${PC_GTK3_LIBRARY_DIRS}
)
else()
set( GTK3_LIBRARY ${PC_GTK3_LIBRARIES} )
set( GTK3_INCLUDE_DIR ${PC_GTK3_INCLUDEDIR} ${PC_GTK3_INCLUDE_DIRS} )
endif()
# handle the QUIETLY and REQUIRED arguments and set GTK3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTK3 DEFAULT_MSG GTK3_LIBRARY GTK3_INCLUDE_DIR)
if( GTK3_FOUND )
set( GTK3_LIBRARIES ${GTK3_LIBRARY} )
set( GTK3_INCLUDE_DIRS ${GTK3_INCLUDE_DIR} )
else()
set( GTK3_LIBRARIES )
set( GTK3_INCLUDE_DIRS )
endif()
MARK_AS_ADVANCED(GTK3_INCLUDE_DIRS GTK3_LIBRARIES)
|