Debian Codegraph @

cmake/FindLttoolbox3.cmake

raw
1 # - Try to find Lttoolbox3
2 # Once done this will define
3 #
4 # LTTOOLBOX3_FOUND - system has Lttoolbox3
5 # LTTOOLBOX3_INCLUDE_DIR - the Lttoolbox3 include directory
6 # LTTOOLBOX3_LIBRARIES - the libraries needed to use Lttoolbox3
7 # LTTOOLBOX3_DEFINITIONS - Compiler switches required for using Lttoolbox3
8 #
9 # Copyright (c) 2006, Alexander Neundorf <[email protected]>
10 # This code is available under the BSD license, see licenses/BSD for details.
11
12 # Copyright (c) 2006, Alexander Neundorf, <[email protected]>
13 #
14 # Redistribution and use is allowed according to the terms of the BSD license.
15 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
16 #
17 # This is derived from FindLibXml2.cmake
18
19 IF (LTTOOLBOX3_INCLUDE_DIR AND LTTOOLBOX3_LIBRARIES)
20 # in cache already
21 SET(Lttoolbox3_FIND_QUIETLY TRUE)
22 ENDIF (LTTOOLBOX3_INCLUDE_DIR AND LTTOOLBOX3_LIBRARIES)
23
24 IF (NOT WIN32)
25 # use pkg-config to get the directories and then use these values
26 # in the FIND_PATH() and FIND_LIBRARY() calls
27 INCLUDE(UsePkgConfig)
28 PKGCONFIG(lttoolbox-3.0 LTTOOLBOX3_INCLUDES LTTOOLBOX3_LIB_DIR LTTOOLBOX3_LDFLAGS LTTOOLBOX3_CFLAGS)
29 SET(LTTOOLBOX3_DEFINITIONS ${LTTOOLBOX3_CFLAGS})
30 ENDIF (NOT WIN32)
31
32 FIND_PATH(LTTOOLBOX3_INCLUDE_DIR lttoolbox/alphabet.h
33 PATHS ${LTTOOLBOX3_INCLUDES}
34 PATH_SUFFIXES lttoolbox-3.0)
35
36 FIND_LIBRARY(LTTOOLBOX3_LIBRARIES
37 NAMES lttoolbox3
38 PATHS ${LTTOOLBOX3_LIB_DIR})
39
40 IF (LTTOOLBOX3_INCLUDE_DIR AND LTTOOLBOX3_LIBRARIES)
41 SET(LTTOOLBOX3_FOUND TRUE)
42 ELSE (LTTOOLBOX3_INCLUDE_DIR AND LTTOOLBOX3_LIBRARIES)
43 SET(LTTOOLBOX3_FOUND FALSE)
44 ENDIF (LTTOOLBOX3_INCLUDE_DIR AND LTTOOLBOX3_LIBRARIES)
45
46 IF (LTTOOLBOX3_FOUND)
47 IF (NOT Lttoolbox3_FIND_QUIETLY)
48 MESSAGE(STATUS "Found Lttoolbox3: ${LTTOOLBOX3_LIBRARIES}")
49 ENDIF (NOT Lttoolbox3_FIND_QUIETLY)
50 ELSE (LTTOOLBOX3_FOUND)
51 IF (Lttoolbox3_FIND_REQUIRED)
52 MESSAGE(SEND_ERROR "Could NOT find Lttoolbox3")
53 ENDIF (Lttoolbox3_FIND_REQUIRED)
54 ENDIF (LTTOOLBOX3_FOUND)
55
56 MARK_AS_ADVANCED(LTTOOLBOX3_INCLUDE_DIR LTTOOLBOX3_LIBRARIES)
57