summaryrefslogtreecommitdiffstats
path: root/contrib/cmake/FindExpect.cmake
blob: 889c57f2f13d2395a1d82686e08725d20ca1e843 (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
48
FIND_PATH(EXPECT_INCLUDE_DIR expect.h
  PATH_SUFFIXES include
  PATHS
  /usr/local
  /usr
  /sw # Fink
  /opt/local # DarwinPorts
  /opt/csw # Blastwave
  /opt
)

set(EXPECT_LIBRARY)

FIND_LIBRARY(EXPECT_LIBRARY_RELEASE
  NAMES expect
  PATHS
  /usr/local
  /usr
  /sw
  /opt/local
  /opt/csw
  /opt
)
if (EXPECT_LIBRARY_RELEASE)
	list(APPEND EXPECT_LIBRARY optimized ${EXPECT_LIBRARY_RELEASE})
endif()

FIND_LIBRARY(EXPECT_LIBRARY_DEBUG
  NAMES expectd expect_d
  PATHS
  /usr/local
  /usr
  /sw
  /opt/local
  /opt/csw
  /opt
)
if (EXPECT_LIBRARY_DEBUG)
	list(APPEND EXPECT_LIBRARY debug ${EXPECT_LIBRARY_DEBUG})
else()
	list(APPEND EXPECT_LIBRARY debug ${EXPECT_LIBRARY_RELEASE})
endif()

# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPECT DEFAULT_MSG EXPECT_LIBRARY_RELEASE EXPECT_LIBRARY EXPECT_INCLUDE_DIR)
MARK_AS_ADVANCED(EXPECT_LIBRARY_RELEASE EXPECT_LIBRARY_DEBUG)