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