FindGnomeVFS2.cmake revision 0586e948b7fc1e97fa7cdddf926e4ec768a40392
744N/A# - Try to find GnomeVFS2
744N/A# Once done this will define
744N/A#
744N/A# GNOMEVFS2_FOUND - system has GnomeVFS2
744N/A# GNOMEVFS2_INCLUDE_DIRS - the GnomeVFS2 include directory
744N/A# GNOMEVFS2_LIBRARIES - Link these to use GnomeVFS2
744N/A# GNOMEVFS2_DEFINITIONS - Compiler switches required for using GnomeVFS2
744N/A#
744N/A# Copyright (c) 2008 Joshua L. Blocher <verbalshadow@gmail.com>
744N/A#
744N/A# Redistribution and use is allowed according to the terms of the New
744N/A# BSD license.
744N/A# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
744N/A#
744N/A
744N/A
744N/Aif (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)
744N/A # in cache already
744N/A set(GNOMEVFS2_FOUND TRUE)
744N/Aelse (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)
744N/A # use pkg-config to get the directories and then use these values
744N/A # in the FIND_PATH() and FIND_LIBRARY() calls
744N/A if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
744N/A include(UsePkgConfig)
744N/A pkgconfig(gnome-vfs-2.0 _GNOMEVFS2_INCLUDEDIR _GNOMEVFS2_LIBDIR _GNOMEVFS2_LDFLAGS _GNOMEVFS2_CFLAGS)
744N/A else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
744N/A find_package(PkgConfig)
744N/A if (PKG_CONFIG_FOUND)
744N/A pkg_check_modules(_GNOMEVFS2 gnome-vfs-2.0)
744N/A endif (PKG_CONFIG_FOUND)
744N/A endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
749N/A find_path(GNOMEVFS2_INCLUDE_DIR
744N/A NAMES
749N/A libgnomevfs/gnome-vfs.h
744N/A PATHS
744N/A ${_GNOMEVFS2_INCLUDEDIR}
744N/A /usr/include
744N/A /usr/local/include
744N/A /opt/local/include
744N/A /sw/include
781N/A PATH_SUFFIXES
744N/A gnome-vfs-2.0
781N/A )
744N/A
744N/A find_library(GNOMEVFS-2_LIBRARY
744N/A NAMES
744N/A gnomevfs-2
744N/A PATHS
744N/A ${_GNOMEVFS2_LIBDIR}
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
)
if (GNOMEVFS-2_LIBRARY)
set(GNOMEVFS-2_FOUND TRUE)
endif (GNOMEVFS-2_LIBRARY)
set(GNOMEVFS2_INCLUDE_DIRS
${GNOMEVFS2_INCLUDE_DIR}
)
if (GNOMEVFS-2_FOUND)
set(GNOMEVFS2_LIBRARIES
${GNOMEVFS2_LIBRARIES}
${GNOMEVFS-2_LIBRARY}
)
endif (GNOMEVFS-2_FOUND)
if (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES)
set(GNOMEVFS2_FOUND TRUE)
endif (GNOMEVFS2_INCLUDE_DIRS AND GNOMEVFS2_LIBRARIES)
if (GNOMEVFS2_FOUND)
if (NOT GnomeVFS2_FIND_QUIETLY)
message(STATUS "Found GnomeVFS2: ${GNOMEVFS2_LIBRARIES}")
endif (NOT GnomeVFS2_FIND_QUIETLY)
else (GNOMEVFS2_FOUND)
if (GnomeVFS2_FIND_REQUIRED)
message(FATAL_ERROR "Could not find GnomeVFS2")
endif (GnomeVFS2_FIND_REQUIRED)
endif (GNOMEVFS2_FOUND)
# show the GNOMEVFS2_INCLUDE_DIRS and GNOMEVFS2_LIBRARIES variables only in the advanced view
mark_as_advanced(GNOMEVFS2_INCLUDE_DIRS GNOMEVFS2_LIBRARIES)
endif (GNOMEVFS2_LIBRARIES AND GNOMEVFS2_INCLUDE_DIRS)