ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/CMakeLists.txt
Revision: 1.46
Committed: Wed Nov 22 17:12:58 2023 UTC (5 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.45: +8 -8 lines
Log Message:
chore: Fixes to cmake builds for holodeck and OpenGL thanks to Randolph Fritz

File Contents

# User Rev Content
1 greg 1.1 set(VERSION_FILE "${radiance_BINARY_DIR}/src/util/Version.c")
2 greg 1.3 create_version_file("${VERSION_FILE}")
3 greg 1.1
4 greg 1.12 add_executable(dctimestep dctimestep.c cmbsdf.c cmatrix.c)
5 greg 1.1 target_link_libraries(dctimestep rtrad)
6    
7     add_executable(findglare findglare.c glareval.c glaresrc.c setscan.c)
8     target_link_libraries(findglare rtrad)
9    
10     add_executable(getinfo getinfo.c)
11     target_link_libraries(getinfo rtrad)
12    
13     add_executable(glarendx glarendx.c)
14     target_link_libraries(glarendx rtrad)
15    
16     add_executable(rad rad.c)
17     target_link_libraries(rad rtrad)
18 greg 1.25
19 greg 1.43 add_executable(rcrop rcrop.c)
20     target_link_libraries(rcrop rtrad)
21    
22 greg 1.1 if(WIN32)
23     set(netproc_SOURCES win_netproc.c)
24     else()
25     set(netproc_SOURCES netproc.c)
26     endif()
27 greg 1.25
28 greg 1.1 add_executable(ranimate ranimate.c ${netproc_SOURCES})
29     target_link_libraries(ranimate rtrad)
30    
31     add_executable(rpiece rpiece.c "${VERSION_FILE}")
32     target_link_libraries(rpiece rtrad)
33    
34     add_executable(vwrays vwrays.c)
35     target_link_libraries(vwrays rtrad)
36    
37     add_executable(vwright vwright.c)
38     target_link_libraries(vwright rtrad)
39    
40 greg 1.36 add_executable(dcglare dcglare.c cmbsdf.c cmatrix.c cmglare.c)
41     target_link_libraries(dcglare rtrad)
42    
43 greg 1.1 #the next few libraries all need to include header files from the rt directory
44 greg 1.25 include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../rt")
45 greg 1.1
46     add_executable(ranimove ranimove.c ranimove1.c ranimove2.c)
47     target_link_libraries(ranimove raycalls radiance rtrad)
48    
49     add_executable(rsensor rsensor.c)
50     target_link_libraries(rsensor raycalls radiance rtrad)
51    
52 greg 1.8 add_executable(rttree_reduce rttree_reduce.c)
53     target_link_libraries(rttree_reduce rtrad)
54    
55 greg 1.10 add_executable(rcollate rcollate.c)
56     target_link_libraries(rcollate rtrad)
57    
58 greg 1.18 add_executable(rmtxop rmtxop.c rmatrix.c cmbsdf.c cmatrix.c)
59     target_link_libraries(rmtxop rtrad)
60    
61 greg 1.20 add_executable(wrapBSDF wrapBSDF.c)
62     target_link_libraries(wrapBSDF rtrad)
63    
64 greg 1.13 add_executable(eplus_adduvf eplus_adduvf.c eplus_idf.c)
65     target_link_libraries(eplus_adduvf rtrad)
66    
67 greg 1.19 add_executable(rfluxmtx rfluxmtx.c)
68     target_link_libraries(rfluxmtx rtrad)
69    
70 greg 1.22 add_executable(evalglare evalglare.c pictool.c)
71 greg 1.42 target_link_libraries(evalglare rtrad reetz)
72 greg 1.22
73 greg 1.29 add_executable(radcompare radcompare.c)
74     target_link_libraries(radcompare rtrad)
75    
76 greg 1.34 add_executable(rcode_depth rcode_depth.c)
77 greg 1.30 target_link_libraries(rcode_depth rtrad)
78    
79 greg 1.34 add_executable(rcode_norm rcode_norm.c)
80 greg 1.31 target_link_libraries(rcode_norm rtrad)
81    
82 greg 1.35 add_executable(rcode_ident rcode_ident.c)
83 greg 1.32 target_link_libraries(rcode_ident rtrad)
84    
85 greg 1.1 if(X11_FOUND)
86     add_executable(xglaresrc
87 greg 1.25 xglaresrc.c
88     "${CMAKE_CURRENT_SOURCE_DIR}/../common/x11findwind.c"
89     )
90 greg 1.1 target_link_libraries(xglaresrc rtrad ${X11_LIBRARIES})
91 greg 1.25 install(TARGETS xglaresrc
92     RUNTIME DESTINATION "bin"
93     )
94 greg 1.1 endif()
95    
96 greg 1.4 #glrad needs to link against OpenGL libraries
97     if(APPLE)
98     find_library(OPENGL_gl_LIBRARY
99     NAMES GL MesaGL
100 greg 1.28 PATHS ${X11_LIB_SEARCH_PATH}
101 greg 1.4 )
102     find_library(OPENGL_glu_LIBRARY
103     NAMES GLU MesaGLU
104 greg 1.28 PATHS ${X11_LIB_SEARCH_PATH}
105 greg 1.4 )
106     set(OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY})
107     else()
108     find_package(OpenGL REQUIRED)
109 greg 1.1 include_directories(${OPENGL_INCLUDE_DIR})
110 greg 1.4 endif()
111 greg 1.1
112 greg 1.25 #check if we have SGIStereo.h
113 greg 1.4 find_file(HAVE_SGISTEREO_H "SGIStereo.h" ${OPENGL_INCLUDE_DIR})
114     if(NOT HAVE_SGISTEREO_H)
115 greg 1.25 add_definitions(-DNOSTEREO)
116 greg 1.4 endif()
117 greg 1.14 if(UNIX AND X11_FOUND)
118 greg 1.25 add_executable(glrad glrad.c)
119     target_link_libraries(glrad rgl rtrad ${OPENGL_LIBRARIES} ${X11_LIBRARIES})
120     install(TARGETS glrad
121     RUNTIME DESTINATION "bin"
122     )
123 greg 1.5 if(CMAKE_SYSTEM_NAME STREQUAL "SunOS")
124     target_link_libraries(glrad rt)
125     endif()
126 greg 1.1 endif()
127 greg 1.23
128     if(UNIX)
129 greg 1.25 install(TARGETS rpiece
130     RUNTIME DESTINATION "bin"
131     )
132 greg 1.23 endif()
133    
134 greg 1.25 install(TARGETS
135 greg 1.37 dcglare
136 greg 1.25 dctimestep
137     eplus_adduvf
138     evalglare
139     findglare
140     getinfo
141     glarendx
142     rad
143 greg 1.29 radcompare
144 greg 1.25 ranimate
145     ranimove
146 greg 1.37 rcode_depth
147     rcode_ident
148     rcode_norm
149 greg 1.25 rcollate
150 greg 1.44 rcrop
151 greg 1.25 rfluxmtx
152     rmtxop
153     rsensor
154     rttree_reduce
155     vwrays
156     vwright
157     wrapBSDF
158     RUNTIME DESTINATION "bin"
159     )
160    
161     file(COPY
162     ambpos.cal
163     disk2square.cal
164 greg 1.45 hsv_rgb.cal
165 greg 1.25 klems_full.cal
166     klems_half.cal
167     klems_quarter.cal
168     minimalBSDFt.xml
169     rambpos.cal
170     reinhartb.cal
171     tregsamp.dat
172     WINDOW6BSDFt.xml
173     DESTINATION "${CMAKE_BINARY_DIR}/lib"
174     )
175 greg 1.17
176 greg 1.4 if(WIN32)
177 greg 1.38 add_custom_target(bsdfview ALL
178     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/bsdfview.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/bsdfview.exe -d
179     )
180     add_custom_target(genBSDF ALL
181     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/genBSDF.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/genBSDF.exe -d
182     )
183     add_custom_target(genklemsamp ALL
184     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/genklemsamp.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/genklemsamp.exe -d
185     )
186     add_custom_target(genskyvec ALL
187     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/genskyvec.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/genskyvec.exe -d
188     )
189     add_custom_target(ltpict ALL
190     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/ltpict.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/ltpict.exe -d
191     )
192     add_custom_target(ltview ALL
193     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/ltview.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/ltview.exe -d
194     )
195     add_custom_target(objpict ALL
196     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/objpict.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/objpict.exe -d
197     )
198     add_custom_target(objview ALL
199     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/objview.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/objview.exe -d
200     )
201     add_custom_target(genambpos ALL
202     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/genambpos.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/genambpos.exe -d
203     )
204     add_custom_target(rcode2bmp ALL
205     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/rcode2bmp.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/rcode2bmp.exe -d
206     )
207     add_custom_target(rtpict ALL
208     COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/rtpict.pl -o ${CMAKE_CURRENT_SOURCE_DIR}/rtpict.exe -d
209     )
210 greg 1.40 install(PROGRAMS
211 greg 1.38 bsdfview.exe
212     genBSDF.exe
213     genklemsamp.exe
214     genskyvec.exe
215     ltpict.exe
216     ltview.exe
217     objpict.exe
218     objview.exe
219     genambpos.exe
220     rcode2bmp.exe
221     rtpict.exe
222 greg 1.25 DESTINATION "bin"
223     )
224 greg 1.4 else()
225 greg 1.25 install_without_extension(
226     bsdfview.pl
227     compamb.csh
228     dayfact.csh
229     fieldcomb.csh
230     genBSDF.pl
231 greg 1.38 genambpos.pl
232 greg 1.25 genklemsamp.pl
233     genskyvec.pl
234     glare.csh
235     ltpict.pl
236     ltview.pl
237     objline.csh
238     objpict.pl
239     objview.pl
240     raddepend.csh
241 greg 1.33 rcode2bmp.pl
242 greg 1.25 rlux.csh
243 greg 1.26 rtpict.pl
244 greg 1.25 vinfo.csh
245     )
246 greg 1.46 # add_custom_target(trad ALL
247     # COMMAND csh -f ${CMAKE_CURRENT_SOURCE_DIR}/tradinstall.csh ../../build/bin ../../build/lib
248     # )
249     # install(FILES
250     # ${CMAKE_BINARY_DIR}/bin/trad
251     # DESTINATION "bin"
252     # PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ
253     # )
254 greg 1.4 endif()