FriendFeed plugin and 2 cmake modules added
[choqok:choqok-playground.git] / cmake / modules / FindChoqok.cmake
1 # - Try to find the Choqok library
2 # Once done this will define
3 #
4 #  Choqok_FOUND - system has choqok
5 #  CHOQOK_INCLUDE_DIR - the choqok include directory
6 #  CHOQOK_LIBRARIES - Link these to use choqok
7
8 # Copyright (c) 2010 Mehrdad Momeny <mehrdad.momeny@gmail.com>
9 # I've wrote this based on FindKopete.cmake
10 # Redistribution and use is allowed according to the terms of the BSD license.
11 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
12
13 if(CHOQOK_INCLUDE_DIR AND CHOQOK_LIBRARIES)
14
15   # read from cache
16   set(Choqok_FOUND TRUE)
17
18 else(CHOQOK_INCLUDE_DIR AND CHOQOK_LIBRARIES)
19
20   FIND_PATH(CHOQOK_INCLUDE_DIR
21     NAMES
22     choqok/choqok_export.h
23     PATHS 
24     ${KDE4_INCLUDE_DIR}
25     ${INCLUDE_INSTALL_DIR}
26     )
27   
28   FIND_LIBRARY(CHOQOK_LIBRARIES
29     NAMES
30     choqok
31     PATHS
32     ${KDE4_LIB_DIR}
33     ${LIB_INSTALL_DIR}
34     )
35   if(CHOQOK_INCLUDE_DIR AND CHOQOK_LIBRARIES)
36     set(Choqok_FOUND TRUE)
37   endif(CHOQOK_INCLUDE_DIR AND CHOQOK_LIBRARIES)
38
39   if(Choqok_FOUND)
40     if(NOT Choqok_FIND_QUIETLY)
41       message(STATUS "Found Choqok: ${CHOQOK_LIBRARIES}")
42     endif(NOT Choqok_FIND_QUIETLY)
43   else(Choqok_FOUND)
44     if(Choqok_FIND_REQUIRED)
45       if(NOT CHOQOK_INCLUDE_DIR)
46         message(FATAL_ERROR "Could not find Choqok includes.")
47       endif(NOT CHOQOK_INCLUDE_DIR)
48       if(NOT CHOQOK_LIBRARIES)
49         message(FATAL_ERROR "Could not find Choqok library.")
50       endif(NOT CHOQOK_LIBRARIES)
51     else(Choqok_FIND_REQUIRED)
52       if(NOT CHOQOK_INCLUDE_DIR)
53         message(STATUS "Could not find Choqok includes.")
54       endif(NOT CHOQOK_INCLUDE_DIR)
55       if(NOT CHOQOK_LIBRARIES)
56         message(STATUS "Could not find Choqok library.")
57       endif(NOT CHOQOK_LIBRARIES)
58     endif(Choqok_FIND_REQUIRED)
59   endif(Choqok_FOUND)
60
61 endif(CHOQOK_INCLUDE_DIR AND CHOQOK_LIBRARIES)