]> git.mxchange.org Git - flightgear.git/blob - CMakeModules/FindHtsEngine.cmake
Silence more Clang (Xcode 7) warnings
[flightgear.git] / CMakeModules / FindHtsEngine.cmake
1 # - Try to find HTS Engine
2 # Once done this will define
3 #
4 #  HTS_ENGINE_FOUND - system has HTS Engine
5 #  HTS_ENGINE_INCLUDE_DIRS - the HTS Engine include directory
6 #  HTS_ENGINE_LIBRARIES - Link these to use HTS Engine
7 #  HTS_ENGINE_DEFINITIONS - Compiler switches required for using HTS Engine
8 #
9 #  Copyright (c) 2013 Saikrishna Arcot <saiarcot895@gmail.com>
10 #
11 #  Redistribution and use is allowed according to the terms of the New
12 #  BSD license.
13 #  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14 #
15
16
17 if (HTS_ENGINE_LIBRARIES AND HTS_ENGINE_INCLUDE_DIRS)
18   # in cache already
19   set(HTS_ENGINE_FOUND TRUE)
20 else (HTS_ENGINE_LIBRARIES AND HTS_ENGINE_INCLUDE_DIRS)
21   #set(HTS_ENGINE_DEFINITIONS ${_HTS_EngineCflags})
22   set(HTS_ENGINE_DEFINITIONS "")
23
24   find_path(HTS_ENGINE_INCLUDE_DIR
25     NAMES
26     HTS_engine.h
27     PATHS
28       ${_HTS_EngineIncDir}
29       /usr/include
30       /usr/local/include
31       /opt/local/include
32       /sw/include
33   )
34
35   find_library(HTS_ENGINE_LIBRARY
36     NAMES
37       HTSEngine
38     PATHS
39       ${_HTS_EngineLinkDir}
40       /usr/lib
41       /usr/local/lib
42       /opt/local/lib
43       /sw/lib
44   )
45
46   if (HTS_ENGINE_LIBRARY)
47     set(HTS_ENGINE_FOUND TRUE)
48   endif (HTS_ENGINE_LIBRARY)
49
50   set(HTS_ENGINE_INCLUDE_DIRS
51     ${HTS_ENGINE_INCLUDE_DIR}
52   )
53
54   if (HTS_ENGINE_FOUND)
55     set(HTS_ENGINE_LIBRARIES
56       ${HTS_ENGINE_LIBRARIES}
57       ${HTS_ENGINE_LIBRARY}
58     )
59   endif (HTS_ENGINE_FOUND)
60
61   if (HTS_ENGINE_INCLUDE_DIRS AND HTS_ENGINE_LIBRARIES)
62     set(HTS_ENGINE_FOUND TRUE)
63   endif (HTS_ENGINE_INCLUDE_DIRS AND HTS_ENGINE_LIBRARIES)
64
65   if (HTS_ENGINE_FOUND)
66     if (NOT HTS_Engine_FIND_QUIETLY)
67       message(STATUS "Found HTS Engine: ${HTS_ENGINE_LIBRARIES}")
68     endif (NOT HTS_Engine_FIND_QUIETLY)
69   else (HTS_ENGINE_FOUND)
70     if (HTS_Engine_FIND_REQUIRED)
71             message(FATAL_ERROR "Could not find HTS Engine")
72     endif (HTS_Engine_FIND_REQUIRED)
73   endif (HTS_ENGINE_FOUND)
74
75   # show the HTS_ENGINE_INCLUDE_DIRS and HTS_ENGINE_LIBRARIES variables only in the advanced view
76   mark_as_advanced(HTS_ENGINE_INCLUDE_DIRS HTS_ENGINE_LIBRARIES)
77
78 endif (HTS_ENGINE_LIBRARIES AND HTS_ENGINE_INCLUDE_DIRS)