# - Try to find GDA2 # Once done this will define # # GDA2_FOUND - system has GDA2 # GDA2_INCLUDE_DIRS - the GDA2 include directory # GDA2_LIBRARIES - Link these to use GDA2 # GDA2_DEFINITIONS - Compiler switches required for using GDA2 # # Copyright (c) 2008 Andreas Schneider # # Redistribution and use is allowed according to the terms of the New # BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. # if (GDA2_LIBRARIES AND GDA2_INCLUDE_DIRS) # in cache already set(GDA2_FOUND TRUE) else (GDA2_LIBRARIES AND GDA2_INCLUDE_DIRS) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) include(UsePkgConfig) pkgconfig(libgda _GDA2_INCLUDEDIR _GDA2_LIBDIR _GDA2_LDFLAGS _GDA2_CFLAGS) else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(_GDA2 libgda) endif (PKG_CONFIG_FOUND) endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4) find_path(GDA2_INCLUDE_DIR NAMES libgda/libgda.h PATHS ${_GDA2_INCLUDEDIR} /usr/include /usr/local/include /opt/local/include /sw/include PATH_SUFFIXES libgda-1.2 ) find_library(GDA_LIBRARY NAMES gda-2 PATHS ${_GDA2_LIBDIR} /usr/lib /usr/local/lib /opt/local/lib /sw/lib ) if (GDA_LIBRARY) set(GDA_FOUND TRUE) endif (GDA_LIBRARY) set(GDA2_INCLUDE_DIRS ${GDA2_INCLUDE_DIR} ) if (GDA_FOUND) set(GDA2_LIBRARIES ${GDA2_LIBRARIES} ${GDA_LIBRARY} ) endif (GDA_FOUND) if (GDA2_INCLUDE_DIRS AND GDA2_LIBRARIES) set(GDA2_FOUND TRUE) endif (GDA2_INCLUDE_DIRS AND GDA2_LIBRARIES) if (GDA2_FOUND) if (NOT GDA2_FIND_QUIETLY) message(STATUS "Found GDA2: ${GDA2_LIBRARIES}") endif (NOT GDA2_FIND_QUIETLY) else (GDA2_FOUND) if (GDA2_FIND_REQUIRED) message(FATAL_ERROR "Could not find GDA2") endif (GDA2_FIND_REQUIRED) endif (GDA2_FOUND) # show the GDA2_INCLUDE_DIRS and GDA2_LIBRARIES variables only in the advanced view #mark_as_advanced(GDA2_INCLUDE_DIRS GDA2_LIBRARIES) endif (GDA2_LIBRARIES AND GDA2_INCLUDE_DIRS)