ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/CMakeLists.txt
(Generate patch)

Comparing ray/src/rt/CMakeLists.txt (file contents):
Revision 1.14 by greg, Fri Sep 30 17:59:27 2016 UTC vs.
Revision 1.19 by greg, Fri Aug 2 18:47:25 2024 UTC

# Line 1 | Line 1
1   set(VERSION_FILE "${radiance_BINARY_DIR}/src/rt/Version.c")
2   create_version_file("${VERSION_FILE}")
3  
4 < if(WIN32)
4 > add_library(radiance
5 >  "${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 >  m_clip.c
24 >  m_direct.c
25 >  m_mirror.c
26 >  m_mist.c
27 >  mx_data.c
28 >  mx_func.c
29 >  noise3.c
30 >  normal.c
31 >  o_cone.c
32 >  o_face.c
33 >  o_instance.c
34 >  o_mesh.c
35 >  p_data.c
36 >  p_func.c
37 >  pmap.c
38 >  pmapamb.c
39 >  pmapbias.c
40 >  pmapcontrib.c
41 >  pmapdata.c
42 >  pmapdiag.c
43 >  pmapio.c
44 >  pmapmat.c
45 >  pmapopt.c
46 >  pmapparm.c
47 >  pmaprand.c
48 >  pmapray.c
49 >  pmapsrc.c
50 >  pmaptype.c
51 >  pmcontrib2.c
52 >  pmutil.c
53 >  preload.c
54 >  raytrace.c
55 >  renderopts.c
56 >  source.c
57 >  sphere.c
58 >  srcobstr.c
59 >  srcsamp.c
60 >  srcsupp.c
61 >  t_data.c
62 >  t_func.c
63 >  text.c
64 >  virtuals.c
65 > )
66  
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
67   if(WIN32)
68    set(rayp_SOURCES raypwin.c)
69   else()
# Line 37 | Line 72 | endif()
72  
73   add_library(raycalls raycalls.c ${rayp_SOURCES} rayfifo.c)
74  
75 < add_executable(rtrace  rtmain.c rtrace.c duphead.c persist.c)
75 > add_executable(rtrace rtmain.c rtrace.c duphead.c persist.c)
76   target_link_libraries(rtrace raycalls radiance rtrad)
77  
78   add_executable(rpict rpmain.c rpict.c srcdraw.c duphead.c persist.c)
# Line 49 | Line 84 | target_link_libraries(lookamb rtrad)
84   add_executable(rcontrib rcmain.c rcontrib.c rc2.c rc3.c)
85   target_link_libraries(rcontrib radiance rtrad)
86  
87 < if(NOT WIN32)
88 <  add_executable(mkpmap mkpmap.c)
89 <  target_link_libraries(mkpmap radiance rtrad)
90 <  add_executable(pmapdump pmapdump.c pmaptype.c pmapparm.c)
56 <  target_link_libraries(pmapdump radiance rtrad)
57 < endif()
87 > add_executable(mkpmap mkpmap.c)
88 > target_link_libraries(mkpmap radiance rtrad)
89 > add_executable(pmapdump pmapdump.c pmaptype.c pmapparm.c)
90 > target_link_libraries(pmapdump raycalls radiance rtrad)
91  
92 < set(targets_to_install lookamb radiance raycalls rtrace rpict rcontrib)
93 < if(NOT WIN32)
94 <  set(targets_to_install ${targets_to_install} mkpmap pmapdump)
95 < endif()
92 > set(targets_to_install
93 >  lookamb
94 >  mkpmap
95 >  pmapdump
96 >  radiance
97 >  raycalls
98 >  rcontrib
99 >  rpict
100 >  rtrace
101 > )
102  
103   if(X11_FOUND)
104    set(X11_SOURCES x11.c x11twind.c)
105 <  add_definitions("-DHAS_X11")
105 >  add_definitions(-DHAS_X11)
106   endif()
107 < if(Qt5Widgets_DIR)
107 > if(Qt5Widgets_FOUND AND BUILD_QT)
108    include_directories(${Qt5Widgets_INCLUDE_DIRS})
109 <  add_definitions("-DHAS_QT")
109 >  add_definitions(-DHAS_QT)
110   endif()
111   if(NOT BUILD_HEADLESS)
112 <  if (X11_FOUND OR Qt5Widgets_DIR)
112 >  if(X11_FOUND OR BUILD_QT)
113      add_executable(rvu
114 <      rvmain.c rview.c rv2.c rv3.c devtable.c devcomm.c editline.c ${X11_SOURCES}
115 <      colortab.c)
114 >      colortab.c
115 >      devcomm.c
116 >      devtable.c
117 >      editline.c
118 >      rv2.c
119 >      rv3.c
120 >      rview.c
121 >      rvmain.c
122 >      ${X11_SOURCES}
123 >    )
124      target_link_libraries(rvu raycalls radiance rtrad ${X11_LIBRARIES})
125      list(APPEND targets_to_install rvu)
126  
127      # only link to rvu-qt-lib if qt is found
128 <    if(Qt5Widgets_DIR)
128 >    if(BUILD_QT)
129        target_link_libraries(rvu qtrvu)
130      endif()
131    endif()
132   endif()
133  
134 < add_test(rtrace_Version ${EXECUTABLE_OUTPUT_PATH}/rtrace -version)
135 < set_tests_properties(rtrace_Version PROPERTIES
136 <  PASS_REGULAR_EXPRESSION "RADIANCE")
134 > #add_test(rtrace_version "${EXECUTABLE_OUTPUT_PATH}/rtrace" -version)
135 > #set_tests_properties(rtrace_version PROPERTIES
136 > #  PASS_REGULAR_EXPRESSION "RADIANCE"
137 > #)
138  
139   install(TARGETS ${targets_to_install}
140 <        RUNTIME DESTINATION bin
141 <        LIBRARY DESTINATION bin
142 <        ARCHIVE DESTINATION bin)
143 < install(FILES rayinit.cal DESTINATION lib)
140 >  RUNTIME DESTINATION "bin"
141 >  LIBRARY DESTINATION "bin"
142 >  ARCHIVE DESTINATION "bin"
143 > )
144 > file(COPY rayinit.cal
145 >  DESTINATION "${CMAKE_BINARY_DIR}/lib"
146 > )
147  
148   #install qt.conf & Qt plugins loaded by rvu at runtime. Ignore if we are building as headless
149 < if(NOT BUILD_HEADLESS)
149 > if(NOT BUILD_HEADLESS AND BUILD_QT)
150    get_target_property(GIF_PLUGIN Qt5::QGifPlugin LOCATION)
151    get_target_property(ICO_PLUGIN Qt5::QICOPlugin LOCATION)
152    get_target_property(JPEG_PLUGIN Qt5::QJpegPlugin LOCATION)
102  get_target_property(MNG_PLUGIN Qt5::QMngPlugin LOCATION)
153    get_target_property(TIFF_PLUGIN Qt5::QTiffPlugin LOCATION)
154 <  install(PROGRAMS "${GIF_PLUGIN}" DESTINATION bin/plugins/imageformats)
155 <  install(PROGRAMS "${ICO_PLUGIN}" DESTINATION bin/plugins/imageformats)
156 <  install(PROGRAMS "${JPEG_PLUGIN}" DESTINATION bin/plugins/imageformats)
157 <  install(PROGRAMS "${MNG_PLUGIN}" DESTINATION bin/plugins/imageformats)
158 <  install(PROGRAMS "${TIFF_PLUGIN}" DESTINATION bin/plugins/imageformats)
159 <  install(FILES ${CMAKE_SOURCE_DIR}/InstallRules/qt.conf DESTINATION bin)
154 >  install(PROGRAMS "${GIF_PLUGIN}" "${ICO_PLUGIN}" "${JPEG_PLUGIN}" "${TIFF_PLUGIN}"
155 >    DESTINATION "bin/plugins/imageformats"
156 >  )
157 >  install(FILES "${CMAKE_SOURCE_DIR}/InstallRules/qt.conf"
158 >    DESTINATION "bin"
159 >  )
160  
161 <  if(APPLE OR WIN32)
162 <    if(WIN32)
163 <      get_target_property(QPA_PLUGIN Qt5::QWindowsIntegrationPlugin LOCATION)
164 <    elseif(APPLE)
165 <      get_target_property(QPA_PLUGIN Qt5::QCocoaIntegrationPlugin LOCATION)
166 <    endif()
117 <
118 <    install(PROGRAMS "${QPA_PLUGIN}" DESTINATION bin/plugins/platforms)
161 >  if(WIN32)
162 >    get_target_property(QPA_PLUGIN Qt5::QWindowsIntegrationPlugin LOCATION)
163 >  elseif(APPLE)
164 >    get_target_property(QPA_PLUGIN Qt5::QCocoaIntegrationPlugin LOCATION)
165 >  elseif(UNIX)
166 >    get_target_property(QPA_PLUGIN Qt5::QXcbIntegrationPlugin LOCATION)
167    endif()
168 +
169 +  install(PROGRAMS "${QPA_PLUGIN}"
170 +    DESTINATION "bin/plugins/platforms"
171 +  )
172   endif()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines