-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindLibHamcast.cmake
executable file
·76 lines (69 loc) · 1.99 KB
/
FindLibHamcast.cmake
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# - Try to find libhamcast
# Once done this will define
#
# HAMCAST_FOUND - system has libhamcast
# HAMCAST_INCLUDE - libhamcast include dir
# HAMCAST_LIBRARY - link againgst libhamcast
#
if (HAMCAST_LIBRARY AND HAMCAST_INCLUDE)
set(HAMCAST_FOUND TRUE)
else (HAMCAST_LIBRARY AND HAMCAST_INCLUDE)
find_path(HC_INCLUDE
NAMES
hamcast/hamcast.hpp
PATHS
${HAMCAST_INCLUDE_PATH}
${HAMCAST_LIBRARY_PATH}
${CMAKE_INCLUDE_PATH}
${CMAKE_INSTALL_PREFIX}/include
../libhamcast/include
../../libhamcast/include
../../../libhamcast/include
../../../../libhamcast/include
/usr/include
/usr/local/include
/opt/local/include
/sw/include
)
if (HC_INCLUDE)
message (STATUS "Header files found ...")
else (HC_INCLUDE)
message (SEND_ERROR "Header files NOT found. Provide absolute path with -DHAMCAST_INCLUDE_PATH=<path-to-header>.")
endif (HC_INCLUDE)
find_library(HC_LIBRARY
NAMES
libhamcast
hamcast
PATHS
${HAMCAST_INCLUDE_PATH}
${HAMCAST_INCLUDE_PATH}/.libs
${HAMCAST_LIBRARY_PATH}
${HAMCAST_LIBRARY_PATH}/.libs
${CMAKE_LIBRARY_PATH}
${CMAKE_INSTALL_PREFIX}/lib
../libhamcast/build
../../libhamcast/build
../../../libhamcast/build
../../../../libhamcast/build
/usr/lib
/usr/local/lib
/opt/local/lib
/sw/lib
../lib
../../lib
../../../lib
../../../../lib
)
if (HC_LIBRARY)
message (STATUS "Library found ...")
else (HC_LIBRARY)
message (SEND_ERROR "Library NOT found. Provide absolute path with -DHAMCAST_LIBRARY_PATH=<path-to-library>.")
endif (HC_LIBRARY)
if (HC_INCLUDE AND HC_LIBRARY)
set(HAMCAST_FOUND TRUE)
set(HAMCAST_INCLUDE ${HC_INCLUDE})
set(HAMCAST_LIBRARY ${HC_LIBRARY})
else (HC_INCLUDE AND HC_LIBRARY)
message (FATAL_ERROR "HAMCAST LIBRARY AND/OR HEADER NOT FOUND!")
endif (HC_INCLUDE AND HC_LIBRARY)
endif (HAMCAST_LIBRARY AND HAMCAST_INCLUDE)