Debian Codegraph @

CMakeModules/FindHtsEngine.cmake

raw
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 <[email protected]>
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
70 if(NOT TARGET Flightgear::HTSEngine)
71 add_library(Flightgear::HTSEngine UNKNOWN IMPORTED)
72 set_target_properties(Flightgear::HTSEngine PROPERTIES
73 INTERFACE_INCLUDE_DIRECTORIES "${HTS_ENGINE_INCLUDE_DIRS}"
74 IMPORTED_LINK_INTERFACE_LANGUAGES "C"
75 IMPORTED_LOCATION "${HTS_ENGINE_LIBRARY}")
76 endif()
77
78 else (HTS_ENGINE_FOUND)
79 if (HTS_Engine_FIND_REQUIRED)
80 message(FATAL_ERROR "Could not find HTS Engine")
81 endif (HTS_Engine_FIND_REQUIRED)
82 endif (HTS_ENGINE_FOUND)
83
84 # show the HTS_ENGINE_INCLUDE_DIRS and HTS_ENGINE_LIBRARIES variables only in the advanced view
85 mark_as_advanced(HTS_ENGINE_INCLUDE_DIRS HTS_ENGINE_LIBRARIES)
86
87 endif (HTS_ENGINE_LIBRARIES AND HTS_ENGINE_INCLUDE_DIRS)
88