Adding the cmake subdir
[kdeedu-porting.git] / cmake / modules / FindLibfacile.cmake
blobbef726e56272dd4d82e896703f4371df3b3e45d9
1 # - Try to find Libfacile
2 # Once done this will define
4 #  LIBFACILE_FOUND - system has Libfacile
5 #  LIBFACILE_INCLUDE_DIR - the Libfacile include directory
6 #  LIBFACILE_LIBRARIES - Link these to use Libfacile
7 #  LIBFACILE_DEFINITIONS - Compiler switches required for using Libfacile
9 # Copyright (c) 2006, Carsten Niehaus, <cniehaus@gmx.de>
10 # Copyright (c) 2006, Montel Laurent, <montel@kde.org>
11 # Redistribution and use is allowed according to the terms of the BSD license.
12 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
15 find_package(OCaml)
17 set(LIBFACILE_FOUND FALSE)
19 if( OCAML_FOUND )
20    find_file(LIBFACILE_LIBRARIES NAMES facile.a
21              PATHS
22              ${OCAMLC_DIR}/facile/
23    )
24    #message(STATUS "LIBFACILE_LIBRARIES :<${LIBFACILE_LIBRARIES}>") 
25    find_path(LIBFACILE_INCLUDE_DIR NAMES facile.a
26              PATHS
27              ${OCAMLC_DIR}/
28              PATH_SUFFIXES facile
29    )
30    #message(STATUS "LIBFACILE_INCLUDE_DIR <${LIBFACILE_INCLUDE_DIR}>")
31    if(LIBFACILE_INCLUDE_DIR AND LIBFACILE_LIBRARIES)
32       set(LIBFACILE_FOUND TRUE)
33    endif(LIBFACILE_INCLUDE_DIR AND LIBFACILE_LIBRARIES)
34 endif(OCAML_FOUND)
37 if(LIBFACILE_FOUND)
38    if(NOT Libfacile_FIND_QUIETLY)
39       message(STATUS "Found Libfacile: ${LIBFACILE_LIBRARIES}")
40    endif(NOT Libfacile_FIND_QUIETLY)
41 else(LIBFACILE_FOUND)
42    if(Libfacile_FIND_REQUIRED)
43       message(FATAL_ERROR "Could not find Libfacile")
44    endif(Libfacile_FIND_REQUIRED)
45 endif(LIBFACILE_FOUND)
47 # show the LIBFACILE_INCLUDE_DIR and LIBFACILE_LIBRARIES variables only in the advanced view
48 mark_as_advanced(LIBFACILE_INCLUDE_DIR LIBFACILE_LIBRARIES )