ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/CMakeLists.txt
Revision: 1.21
Committed: Wed Jul 23 16:20:13 2025 UTC (6 days, 19 hours ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad6R0
Changes since 1.20: +13 -0 lines
Log Message:
chore: Build updates to compile rxpiece on non-Window machines (thanks to Mingbo Peng)

File Contents

# User Rev Content
1 greg 1.1 set(VERSION_FILE "${radiance_BINARY_DIR}/src/rt/Version.c")
2 greg 1.3 create_version_file("${VERSION_FILE}")
3 greg 1.1
4 greg 1.15 add_library(radiance
5 greg 1.17 "${VERSION_FILE}"
6     ../common/paths.c
7     ../common/platform.h
8     ../common/random.h
9     ambcomp.c
10     ambient.c
11     ambio.c
12     aniso.c
13     ashikhmin.c
14     dielectric.c
15     fprism.c
16     freeobjmem.c
17     func.c
18     glass.c
19     initotypes.c
20     m_alias.c
21     m_brdf.c
22     m_bsdf.c
23 greg 1.20 m_wgmdf.c
24 greg 1.17 m_clip.c
25     m_direct.c
26     m_mirror.c
27     m_mist.c
28     mx_data.c
29     mx_func.c
30     noise3.c
31     normal.c
32     o_cone.c
33     o_face.c
34     o_instance.c
35     o_mesh.c
36     p_data.c
37     p_func.c
38     pmap.c
39     pmapamb.c
40     pmapbias.c
41     pmapcontrib.c
42     pmapdata.c
43     pmapdiag.c
44     pmapio.c
45     pmapmat.c
46     pmapopt.c
47     pmapparm.c
48     pmaprand.c
49     pmapray.c
50     pmapsrc.c
51     pmaptype.c
52     pmcontrib2.c
53     pmutil.c
54     preload.c
55     raytrace.c
56     renderopts.c
57     source.c
58     sphere.c
59     srcobstr.c
60     srcsamp.c
61     srcsupp.c
62     t_data.c
63     t_func.c
64     text.c
65     virtuals.c
66     )
67 greg 1.1
68     if(WIN32)
69     set(rayp_SOURCES raypwin.c)
70     else()
71     set(rayp_SOURCES raypcalls.c)
72     endif()
73    
74     add_library(raycalls raycalls.c ${rayp_SOURCES} rayfifo.c)
75    
76 greg 1.17 add_executable(rtrace rtmain.c rtrace.c duphead.c persist.c)
77 greg 1.1 target_link_libraries(rtrace raycalls radiance rtrad)
78    
79     add_executable(rpict rpmain.c rpict.c srcdraw.c duphead.c persist.c)
80     target_link_libraries(rpict radiance rtrad)
81 greg 1.9
82     add_executable(lookamb lookamb.c ambio.c)
83     target_link_libraries(lookamb rtrad)
84    
85     add_executable(rcontrib rcmain.c rcontrib.c rc2.c rc3.c)
86     target_link_libraries(rcontrib radiance rtrad)
87    
88 greg 1.15 add_executable(mkpmap mkpmap.c)
89     target_link_libraries(mkpmap radiance rtrad)
90     add_executable(pmapdump pmapdump.c pmaptype.c pmapparm.c)
91     target_link_libraries(pmapdump raycalls radiance rtrad)
92 greg 1.10
93 greg 1.17 set(targets_to_install
94     lookamb
95     mkpmap
96     pmapdump
97     radiance
98     raycalls
99     rcontrib
100     rpict
101     rtrace
102     )
103 greg 1.9
104 greg 1.1 if(X11_FOUND)
105     set(X11_SOURCES x11.c x11twind.c)
106 greg 1.17 add_definitions(-DHAS_X11)
107 greg 1.1 endif()
108 greg 1.18 if(Qt5Widgets_FOUND AND BUILD_QT)
109 greg 1.11 include_directories(${Qt5Widgets_INCLUDE_DIRS})
110 greg 1.17 add_definitions(-DHAS_QT)
111 greg 1.1 endif()
112 greg 1.13 if(NOT BUILD_HEADLESS)
113 greg 1.18 if(X11_FOUND OR BUILD_QT)
114 greg 1.13 add_executable(rvu
115 greg 1.17 colortab.c
116     devcomm.c
117     devtable.c
118     editline.c
119     rv2.c
120     rv3.c
121     rview.c
122     rvmain.c
123     ${X11_SOURCES}
124     )
125 greg 1.13 target_link_libraries(rvu raycalls radiance rtrad ${X11_LIBRARIES})
126     list(APPEND targets_to_install rvu)
127    
128 greg 1.21 if(NOT WIN32)
129     add_executable(rxpiece
130     rxpiece.cpp
131     RpictSimulManager.cpp
132     RtraceSimulManager.cpp
133     ../common/abitmap.cpp
134     srcdraw.c
135     )
136     target_link_libraries(rxpiece raycalls radiance rtrad)
137    
138     list(APPEND targets_to_install rxpiece)
139     endif()
140    
141 greg 1.13 # only link to rvu-qt-lib if qt is found
142 greg 1.18 if(BUILD_QT)
143 greg 1.13 target_link_libraries(rvu qtrvu)
144     endif()
145 greg 1.9 endif()
146 greg 1.1 endif()
147    
148 greg 1.17 #add_test(rtrace_version "${EXECUTABLE_OUTPUT_PATH}/rtrace" -version)
149     #set_tests_properties(rtrace_version PROPERTIES
150     # PASS_REGULAR_EXPRESSION "RADIANCE"
151     #)
152 greg 1.1
153 greg 1.9 install(TARGETS ${targets_to_install}
154 greg 1.17 RUNTIME DESTINATION "bin"
155     LIBRARY DESTINATION "bin"
156     ARCHIVE DESTINATION "bin"
157     )
158     file(COPY rayinit.cal
159     DESTINATION "${CMAKE_BINARY_DIR}/lib"
160     )
161 greg 1.5
162 greg 1.12 #install qt.conf & Qt plugins loaded by rvu at runtime. Ignore if we are building as headless
163 greg 1.18 if(NOT BUILD_HEADLESS AND BUILD_QT)
164 greg 1.12 get_target_property(GIF_PLUGIN Qt5::QGifPlugin LOCATION)
165     get_target_property(ICO_PLUGIN Qt5::QICOPlugin LOCATION)
166     get_target_property(JPEG_PLUGIN Qt5::QJpegPlugin LOCATION)
167     get_target_property(TIFF_PLUGIN Qt5::QTiffPlugin LOCATION)
168 greg 1.17 install(PROGRAMS "${GIF_PLUGIN}" "${ICO_PLUGIN}" "${JPEG_PLUGIN}" "${TIFF_PLUGIN}"
169     DESTINATION "bin/plugins/imageformats"
170     )
171     install(FILES "${CMAKE_SOURCE_DIR}/InstallRules/qt.conf"
172     DESTINATION "bin"
173     )
174    
175     if(WIN32)
176     get_target_property(QPA_PLUGIN Qt5::QWindowsIntegrationPlugin LOCATION)
177     elseif(APPLE)
178     get_target_property(QPA_PLUGIN Qt5::QCocoaIntegrationPlugin LOCATION)
179     elseif(UNIX)
180     get_target_property(QPA_PLUGIN Qt5::QXcbIntegrationPlugin LOCATION)
181     endif()
182 greg 1.12
183 greg 1.17 install(PROGRAMS "${QPA_PLUGIN}"
184     DESTINATION "bin/plugins/platforms"
185     )
186 greg 1.11 endif()