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