1 |
# Find a NVidia Cg Toolkit installation |
2 |
# This module finds a NVidia Cg Toolkit installation. |
3 |
|
4 |
# CG_FOUND found Cg |
5 |
# CG_INCLUDE_DIRS include path to cg.h |
6 |
# CG_LIBRARIES path to Cg libs |
7 |
# CG_COMPILER path to Cg compiler |
8 |
|
9 |
# find Cg on Windows |
10 |
if(WIN32) |
11 |
# find Cg compiler |
12 |
find_program(CG_COMPILER cgc PATHS |
13 |
"C:/Program Files/NVIDIA Corporation/cg/bin" |
14 |
DOC "Path to the Cg compiler.") |
15 |
|
16 |
# find Cg include |
17 |
find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS |
18 |
"C:/Program Files/NVIDIA Corporation/cg/include" |
19 |
DOC "Path to the Cg/GL includes.") |
20 |
|
21 |
# find Cg libraries |
22 |
# Cg library |
23 |
find_library(CG_LIBRARY NAMES Cg PATHS |
24 |
"C:/Program Files/NVIDIA Corporation/cg/lib" |
25 |
DOC "Path to the Cg library.") |
26 |
|
27 |
# Cg GL library |
28 |
find_library(CG_GL_LIBRARY NAMES CgGL PATHS |
29 |
"C:/Program Files/NVIDIA Corporation/cg/lib" |
30 |
DOC "Path to the CgGL library.") |
31 |
|
32 |
set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY}) |
33 |
|
34 |
else(WIN32) # Unix based OS |
35 |
# find Cg compiler |
36 |
find_program(CG_COMPILER cgc PATHS |
37 |
/usr/bin |
38 |
/usr/local/bin |
39 |
/opt/nvidia-cg-toolkit/bin |
40 |
DOC "Path to the Cg compiler.") |
41 |
|
42 |
# find Cg include |
43 |
find_path(CG_INCLUDE_DIRS NAMES Cg/cg.h GL/glext.h PATHS |
44 |
/usr/include |
45 |
/usr/local/include |
46 |
/opt/nvidia-cg-toolkit/include |
47 |
DOC "Path to the Cg/GL includes.") |
48 |
|
49 |
# find Cg libraries |
50 |
# Cg library |
51 |
find_library(CG_LIBRARY NAMES Cg PATHS |
52 |
/usr/include |
53 |
/usr/local/lib |
54 |
/opt/nvidia-cg-toolkit/lib |
55 |
DOC "Path to the Cg library.") |
56 |
|
57 |
# Cg GL library |
58 |
find_library(CG_GL_LIBRARY NAMES CgGL PATHS |
59 |
/usr/include |
60 |
/usr/local/lib |
61 |
/opt/nvidia-cg-toolkit/lib |
62 |
DOC "Path to the CgGL library.") |
63 |
|
64 |
set(CG_LIBRARIES ${CG_LIBRARY} ${CG_GL_LIBRARY}) |
65 |
endif(WIN32) |
66 |
|
67 |
# handle the QUIETLY and REQUIRED arguments and set CG_FOUND to TRUE if |
68 |
# all listed variables are TRUE |
69 |
include(FindPackageHandleStandardArgs) |
70 |
find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARIES CG_INCLUDE_DIRS) |
71 |
|
72 |
mark_as_advanced(CG_FOUND CG_INCLUDE_DIRS CG_LIBRARIES CG_COMPILER) |
73 |
|