forked from osmocom/wireshark
4bfd2dfdf1
http://www.opensync.org/browser/branches/3rd-party-cmake-modules/modules + split out FindGMODULE2.cmake + contains /sw/... by default + supposedly tested on OSX - Disable pcre for cmake builds by default, gregex should be picked up automatically if glib2 is not too old. Should you have trouble linking due to some libgmodule... stuff undefined, please add "${GMODULE2_LIBRARIES}" after "${GLIB2_LIBRARIES}" an report back. svn path=/trunk/; revision=34248
60 lines
1.9 KiB
CMake
60 lines
1.9 KiB
CMake
#
|
|
# $Id$
|
|
#
|
|
# - Try to find GModule2
|
|
# Find GModule headers, libraries and the answer to all questions.
|
|
#
|
|
# GMODULE2_FOUND True if GMODULE2 got found
|
|
# GMODULE2_INCLUDE_DIRS Location of GMODULE2 headers
|
|
# GMODULE2_LIBRARIES List of libraries to use GMODULE2
|
|
#
|
|
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
|
|
#
|
|
# Redistribution and use is allowed according to the terms of the New
|
|
# BSD license.
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
|
#
|
|
|
|
INCLUDE( FindPkgConfig )
|
|
|
|
IF ( GMODULE2_FIND_REQUIRED )
|
|
SET( _pkgconfig_REQUIRED "REQUIRED" )
|
|
ELSE( GMODULE2_FIND_REQUIRED )
|
|
SET( _pkgconfig_REQUIRED "" )
|
|
ENDIF ( GMODULE2_FIND_REQUIRED )
|
|
|
|
IF ( GMODULE2_MIN_VERSION )
|
|
PKG_SEARCH_MODULE( GMODULE2 ${_pkgconfig_REQUIRED} gmodule-2.0>=${GMODULE2_MIN_VERSION} )
|
|
ELSE ( GMODULE2_MIN_VERSION )
|
|
PKG_SEARCH_MODULE( GMODULE2 ${_pkgconfig_REQUIRED} gmodule-2.0 )
|
|
ENDIF ( GMODULE2_MIN_VERSION )
|
|
|
|
|
|
IF( NOT GMODULE2_FOUND AND NOT PKG_CONFIG_FOUND )
|
|
FIND_PATH( GMODULE2_INCLUDE_DIRS gmodule.h PATH_SUFFIXES glib-2.0 )
|
|
|
|
IF ( APPLE )
|
|
FIND_LIBRARY( GMODULE2_LIBRARIES glib )
|
|
ELSE ( APPLE )
|
|
FIND_LIBRARY( GMODULE2_LIBRARIES NAMES gmodule-2.0 gmodule )
|
|
ENDIF (APPLE)
|
|
|
|
# Report results
|
|
IF ( GMODULE2_LIBRARIES AND GMODULE2_INCLUDE_DIRS )
|
|
SET( GMODULE2_FOUND 1 )
|
|
IF ( NOT GMODULE2_FIND_QUIETLY )
|
|
MESSAGE( STATUS "Found GMODULE2: ${GMODULE2_LIBRARIES} ${GMODULE2_INCLUDE_DIRS}" )
|
|
ENDIF ( NOT GMODULE2_FIND_QUIETLY )
|
|
ELSE ( GMODULE2_LIBRARIES AND GMODULE2_INCLUDE_DIRS )
|
|
IF ( GMODULE2_FIND_REQUIRED )
|
|
MESSAGE( SEND_ERROR "Could NOT find GMODULE2" )
|
|
ELSE ( GMODULE2_FIND_REQUIRED )
|
|
IF ( NOT GMODULE2_FIND_QUIETLY )
|
|
MESSAGE( STATUS "Could NOT find GMODULE2" )
|
|
ENDIF ( NOT GMODULE2_FIND_QUIETLY )
|
|
ENDIF ( GMODULE2_FIND_REQUIRED )
|
|
ENDIF ( GMODULE2_LIBRARIES AND GMODULE2_INCLUDE_DIRS )
|
|
ENDIF( NOT GMODULE2_FOUND AND NOT PKG_CONFIG_FOUND )
|
|
|
|
MARK_AS_ADVANCED( GMODULE2_LIBRARIES GMODULE2_INCLUDE_DIRS )
|