FindAkabeiCore.cmake 2.06 KB
Newer Older
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
# - Try to find the akabei core library
# Once done this will define
#
#  AKABEICORE_FOUND - system has akabei core
#  AKABEICORE_INCLUDE_DIR - the akabei core include directory
#  AKABEICORE_LIBRARIES - Link these to use akabei core

# Copyright (c) 2007 Joris Guisson <joris.guisson@gmail.com> (This was based upon FindKTorrent.cmake)
# Copyright (c) 2007 Charles Connell <charles@connells.org> (This was based upon FindKopete.cmake)
# Copyright (c) 2010 Lukas Appelhans <l.appelhans@gmx.de>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

if(AKABEICORE_INCLUDE_DIR AND AKABEICORE_LIBRARIES)

  # read from cache
  set(AKABEICORE_FOUND TRUE)

else(AKABEICORE_INCLUDE_DIR AND AKABEICORE_LIBRARIES)

  FIND_PATH(AKABEICORE_INCLUDE_DIR 
    NAMES
    akabeibackend.h
    PATHS
    ${INCLUDE_INSTALL_DIR}
    PATH_SUFFIXES
    akabeicore
    )
  
  FIND_LIBRARY(AKABEICORE_LIBRARIES 
    NAMES
    akabeicore
    PATHS
    ${LIB_INSTALL_DIR}
    )
  if(AKABEICORE_INCLUDE_DIR AND AKABEICORE_LIBRARIES)
    set(AKABEICORE_FOUND TRUE)
  endif(AKABEICORE_INCLUDE_DIR AND AKABEICORE_LIBRARIES)

  if(AKABEICORE_FOUND)
    if(NOT AKABEICORE_FIND_QUIETLY)
      message(STATUS "Found akabei core: ${AKABEICORE_LIBRARIES} ")
    endif(NOT AKABEICORE_FIND_QUIETLY)
  else(AKABEICORE_FOUND)
    if(AKABEICORE_FIND_REQUIRED)
      if(NOT AKABEICORE_INCLUDE_DIR)
	message(FATAL_ERROR "Could not find akabei core includes.")
      endif(NOT AKABEICORE_INCLUDE_DIR)
      if(NOT AKABEICORE_LIBRARIES)
	message(FATAL_ERROR "Could not find akabei core library.")
      endif(NOT AKABEICORE_LIBRARIES)
    else(AKABEICORE_FIND_REQUIRED)
      if(NOT AKABEICORE_INCLUDE_DIR)
        message(STATUS "Could not find akabei core includes.")
      endif(NOT AKABEICORE_INCLUDE_DIR)
      if(NOT AKABEICORE_LIBRARIES)
        message(STATUS "Could not find akabei core library.")
      endif(NOT AKABEICORE_LIBRARIES)
    endif(AKABEICORE_FIND_REQUIRED)
  endif(AKABEICORE_FOUND)

endif(AKABEICORE_INCLUDE_DIR AND AKABEICORE_LIBRARIES)