| 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 |
|
|
add_library(radiance
|
| 5 |
greg |
1.8 |
ambcomp.c ambient.c ambio.c aniso.c ashikhmin.c data.c dielectric.c fprism.c freeobjmem.c
|
| 6 |
greg |
1.1 |
func.c glass.c initotypes.c m_alias.c m_brdf.c m_bsdf.c m_clip.c m_direct.c
|
| 7 |
|
|
m_mirror.c m_mist.c mx_func.c mx_data.c noise3.c normal.c o_face.c o_cone.c
|
| 8 |
|
|
o_instance.c o_mesh.c p_data.c p_func.c preload.c raytrace.c renderopts.c
|
| 9 |
|
|
source.c sphere.c srcobstr.c srcsupp.c srcsamp.c t_data.c t_func.c text.c
|
| 10 |
greg |
1.10 |
pmap.c pmapsrc.c pmapmat.c pmaprand.c pmapio.c
|
| 11 |
|
|
pmapbias.c pmapparm.c pmapcontrib.c pmapamb.c pmapray.c pmapopt.c
|
| 12 |
|
|
pmapdata.c pmapdiag.c pmaptype.c
|
| 13 |
greg |
1.1 |
"${VERSION_FILE}" virtuals.c)
|
| 14 |
|
|
|
| 15 |
|
|
if(WIN32)
|
| 16 |
|
|
set(rayp_SOURCES raypwin.c)
|
| 17 |
|
|
else()
|
| 18 |
|
|
set(rayp_SOURCES raypcalls.c)
|
| 19 |
|
|
endif()
|
| 20 |
|
|
|
| 21 |
|
|
add_library(raycalls raycalls.c ${rayp_SOURCES} rayfifo.c)
|
| 22 |
|
|
|
| 23 |
|
|
add_executable(rtrace rtmain.c rtrace.c duphead.c persist.c)
|
| 24 |
|
|
target_link_libraries(rtrace raycalls radiance rtrad)
|
| 25 |
|
|
|
| 26 |
|
|
add_executable(rpict rpmain.c rpict.c srcdraw.c duphead.c persist.c)
|
| 27 |
|
|
target_link_libraries(rpict radiance rtrad)
|
| 28 |
greg |
1.9 |
|
| 29 |
|
|
add_executable(lookamb lookamb.c ambio.c)
|
| 30 |
|
|
target_link_libraries(lookamb rtrad)
|
| 31 |
|
|
|
| 32 |
|
|
add_executable(rcontrib rcmain.c rcontrib.c rc2.c rc3.c)
|
| 33 |
|
|
target_link_libraries(rcontrib radiance rtrad)
|
| 34 |
|
|
|
| 35 |
greg |
1.10 |
add_executable(mkpmap mkpmap.c)
|
| 36 |
|
|
target_link_libraries(mkpmap radiance rtrad)
|
| 37 |
|
|
|
| 38 |
|
|
add_executable(pmapdump pmapdump.c pmaptype.c pmapparm.c)
|
| 39 |
|
|
target_link_libraries(pmapdump radiance rtrad)
|
| 40 |
|
|
|
| 41 |
|
|
set(targets_to_install lookamb radiance raycalls rtrace rpict rcontrib mkpmap pmapdump)
|
| 42 |
greg |
1.9 |
|
| 43 |
greg |
1.1 |
if(X11_FOUND)
|
| 44 |
|
|
set(X11_SOURCES x11.c x11twind.c)
|
| 45 |
|
|
add_definitions("-DHAS_X11")
|
| 46 |
|
|
endif()
|
| 47 |
greg |
1.11 |
if(Qt5Widgets_DIR)
|
| 48 |
|
|
include_directories(${Qt5Widgets_INCLUDE_DIRS})
|
| 49 |
greg |
1.1 |
add_definitions("-DHAS_QT")
|
| 50 |
|
|
endif()
|
| 51 |
greg |
1.11 |
if (X11_FOUND OR Qt5Widgets_DIR)
|
| 52 |
greg |
1.9 |
add_executable(rvu
|
| 53 |
|
|
rvmain.c rview.c rv2.c rv3.c devtable.c devcomm.c editline.c ${X11_SOURCES}
|
| 54 |
|
|
colortab.c)
|
| 55 |
|
|
target_link_libraries(rvu raycalls radiance rtrad ${X11_LIBRARIES})
|
| 56 |
|
|
list(APPEND targets_to_install rvu)
|
| 57 |
|
|
|
| 58 |
|
|
# only link to rvu-qt-lib if qt is found
|
| 59 |
greg |
1.11 |
if(Qt5Widgets_DIR)
|
| 60 |
greg |
1.9 |
target_link_libraries(rvu qtrvu)
|
| 61 |
|
|
endif()
|
| 62 |
greg |
1.1 |
endif()
|
| 63 |
|
|
|
| 64 |
|
|
add_test(rtrace_Version ${EXECUTABLE_OUTPUT_PATH}/rtrace -version)
|
| 65 |
|
|
set_tests_properties(rtrace_Version PROPERTIES
|
| 66 |
|
|
PASS_REGULAR_EXPRESSION "RADIANCE")
|
| 67 |
|
|
|
| 68 |
greg |
1.9 |
install(TARGETS ${targets_to_install}
|
| 69 |
greg |
1.1 |
RUNTIME DESTINATION bin
|
| 70 |
|
|
LIBRARY DESTINATION bin
|
| 71 |
|
|
ARCHIVE DESTINATION bin)
|
| 72 |
greg |
1.4 |
install(FILES rayinit.cal DESTINATION lib)
|
| 73 |
greg |
1.5 |
|
| 74 |
greg |
1.12 |
#install qt.conf & Qt plugins loaded by rvu at runtime. Ignore if we are building as headless
|
| 75 |
|
|
if(NOT BUILD_HEADLESS)
|
| 76 |
|
|
get_target_property(GIF_PLUGIN Qt5::QGifPlugin LOCATION)
|
| 77 |
|
|
get_target_property(ICO_PLUGIN Qt5::QICOPlugin LOCATION)
|
| 78 |
|
|
get_target_property(JPEG_PLUGIN Qt5::QJpegPlugin LOCATION)
|
| 79 |
|
|
get_target_property(MNG_PLUGIN Qt5::QMngPlugin LOCATION)
|
| 80 |
|
|
get_target_property(TIFF_PLUGIN Qt5::QTiffPlugin LOCATION)
|
| 81 |
|
|
install(PROGRAMS "${GIF_PLUGIN}" DESTINATION bin/plugins/imageformats)
|
| 82 |
|
|
install(PROGRAMS "${ICO_PLUGIN}" DESTINATION bin/plugins/imageformats)
|
| 83 |
|
|
install(PROGRAMS "${JPEG_PLUGIN}" DESTINATION bin/plugins/imageformats)
|
| 84 |
|
|
install(PROGRAMS "${MNG_PLUGIN}" DESTINATION bin/plugins/imageformats)
|
| 85 |
|
|
install(PROGRAMS "${TIFF_PLUGIN}" DESTINATION bin/plugins/imageformats)
|
| 86 |
|
|
install(FILES ${CMAKE_SOURCE_DIR}/InstallRules/qt.conf DESTINATION bin)
|
| 87 |
greg |
1.5 |
|
| 88 |
greg |
1.12 |
if(APPLE OR WIN32)
|
| 89 |
|
|
if(WIN32)
|
| 90 |
|
|
get_target_property(QPA_PLUGIN Qt5::QWindowsIntegrationPlugin LOCATION)
|
| 91 |
|
|
elseif(APPLE)
|
| 92 |
|
|
get_target_property(QPA_PLUGIN Qt5::QCocoaIntegrationPlugin LOCATION)
|
| 93 |
|
|
endif()
|
| 94 |
|
|
|
| 95 |
|
|
install(PROGRAMS "${QPA_PLUGIN}" DESTINATION bin/plugins/platforms)
|
| 96 |
greg |
1.11 |
endif()
|
| 97 |
|
|
endif()
|