aboutsummaryrefslogtreecommitdiff
path: root/cmake/Modules/FindFestival.cmake
blob: be453cc741c78f3f0a98fc74a70153f35e8f7dcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# - Try to find Festival and EST
# Once done this will define
#
# Festival_FOUND          - set to true if Festival was found
# Festival_LIBRARIES      - link these to use Festival
# Festival_INCLUDE_DIR    - path to Festival header files

if (Festival_LIBRARIES AND Festival_INCLUDE_DIR)
  # in cache already
  set(Festival_FOUND TRUE)
else (Festival_LIBRARIES AND Festival_INCLUDE_DIR)

  set(CANDIDATE_LIB_DIR
    /usr/lib
    /usr/local/lib
    /usr/lib/festival
    /usr/local/lib/festival
    /usr/local/festival/lib
    /opt/festival/lib
  )
  
  set(CANDIDATE_INC_DIR
    /usr/include
    /usr/include/festival
    /usr/local/include
    /usr/local/include/festival
    /usr/local/festival/include
    /opt/festival/include
  )

  find_path(Festival_INCLUDE_DIR festival.h ${CANDIDATE_INC_DIR})
  find_library(Festival_LIBRARIES Festival ${CANDIDATE_LIB_DIR})

  # status output
  include(FindPackageHandleStandardArgs)

  find_package_handle_standard_args(Festival
    DEFAULT_MSG
    Festival_LIBRARIES
    Festival_INCLUDE_DIR
  )
  mark_as_advanced(
    Festival_INCLUDE_DIR
    Festival_LIBRARIES
  )

endif (Festival_LIBRARIES AND Festival_INCLUDE_DIR)