-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtemplate-FindModule.cmake
76 lines (67 loc) · 2.13 KB
/
template-FindModule.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
##########
#
### Gooborg Studios' Find Module Template
#
# When creating a new find module to add to this repository, use the following format.
# Replace "TemplateLib" with the name of the library.
# Update paths and files to look for as appropriate.
# If the library has multiple parts (i.e. how GraphicsMagick has Magick, Magick++, and MagickWand), copy the calls and modify message as appropriate.
#
# Make sure to remove these top twelve lines before submitting a PR!
#
##########
# -*-cmake-*-
#
# Gooborg Studios - FindTemplateLib.cmake
# http://www.gooborg.com
#
# Search for TemplateLib library files
#
# Once loaded this will define:
# TemplateLib_FOUND - system has TemplateLib
# TemplateLib_INCLUDE_DIR - include directory for TemplateLib
# TemplateLib_LIBRARY_DIR - library directory for TemplateLib
# TemplateLib_LIBRARIES - libraries you need to link to
# Find headers
find_path(TemplateLib_INCLUDE_DIR
NAMES "TemplateLib/TemplateLib.h"
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\TemplateLib\\Current;BinPath]"
"$ENV{TemplateLib_LOCATION}"
"$ENV{TemplateLib_LOCATION}/include"
"$ENV{TemplateLib_LOCATION}/include/TemplateLib"
"$ENV{TemplateLib_HOME}/include"
/usr/include/
/usr/include/TemplateLib
/usr/local/include
/usr/local/include/TemplateLib
/opt/local/include/TemplateLib
)
# Find compiled library file
find_library(TemplateLib_LIBRARIES
NAMES libTemplateLib TemplateLib
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\TemplateLib\\Current;BinPath]"
"$ENV{TemplateLib_LOCATION}/TemplateLib/.libs"
"$ENV{TemplateLib_LOCATION}/lib"
"$ENV{TemplateLib_HOME}/lib"
/usr/lib64
/usr/local/lib64
/opt/local/lib64
/usr/lib
/usr/local/lib
/opt/local/lib
DOC "TemplateLib library"
)
# Get path to library
get_filename_component(TemplateLib_LIBRARY_DIR ${TemplateLib_LIBRARIES} PATH)
# Set variables as advanced (hide from GUI unless "show advanced checked")
mark_as_advanced(TemplateLib_LIBRARIES TemplateLib_LIBRARY_DIR TemplateLib_INCLUDE_DIR)
# Set TemplateLib_FOUND and print message
INCLUDE(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
TemplateLib
DEFAULT_MSG
TemplateLib_LIBRARIES
TemplateLib_INCLUDE_DIR
)