FindAkabeiClient.cmake 2.15 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
#
#  AKABEICLIENT_FOUND - system has akabei core
#  AKABEICLIENT_INCLUDE_DIR - the akabei core include directory
#  AKABEICLIENT_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(AKABEICLIENT_INCLUDE_DIR AND AKABEICLIENT_LIBRARIES)

  # read from cache
  set(AKABEICLIENT_FOUND TRUE)

else(AKABEICLIENT_INCLUDE_DIR AND AKABEICLIENT_LIBRARIES)

  FIND_PATH(AKABEICLIENT_INCLUDE_DIR 
    NAMES
    akabeiclientbackend.h
    PATHS
    ${INCLUDE_INSTALL_DIR}
    PATH_SUFFIXES
    akabeiclient
    )
  
  FIND_LIBRARY(AKABEICLIENT_LIBRARIES 
    NAMES
    akabeiclient
    PATHS
    ${LIB_INSTALL_DIR}
    )
  if(AKABEICLIENT_INCLUDE_DIR AND AKABEICLIENT_LIBRARIES)
    set(AKABEICLIENT_FOUND TRUE)
  endif(AKABEICLIENT_INCLUDE_DIR AND AKABEICLIENT_LIBRARIES)

  if(AKABEICLIENT_FOUND)
    if(NOT AKABEICLIENT_FIND_QUIETLY)
      message(STATUS "Found akabei client: ${AKABEICLIENT_LIBRARIES} ")
    endif(NOT AKABEICLIENT_FIND_QUIETLY)
  else(AKABEICLIENT_FOUND)
    if(AKABEICLIENT_FIND_REQUIRED)
      if(NOT AKABEICLIENT_INCLUDE_DIR)
	message(FATAL_ERROR "Could not find akabei client includes.")
      endif(NOT AKABEICLIENT_INCLUDE_DIR)
      if(NOT AKABEICLIENT_LIBRARIES)
	message(FATAL_ERROR "Could not find akabei client library.")
      endif(NOT AKABEICLIENT_LIBRARIES)
    else(AKABEICLIENT_FIND_REQUIRED)
      if(NOT AKABEICLIENT_INCLUDE_DIR)
        message(STATUS "Could not find akabei client includes.")
      endif(NOT AKABEICLIENT_INCLUDE_DIR)
      if(NOT AKABEICLIENT_LIBRARIES)
        message(STATUS "Could not find akabei client library.")
      endif(NOT AKABEICLIENT_LIBRARIES)
    endif(AKABEICLIENT_FIND_REQUIRED)
  endif(AKABEICLIENT_FOUND)

endif(AKABEICLIENT_INCLUDE_DIR AND AKABEICLIENT_LIBRARIES)