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

Comparing ray/src/px/CMakeLists.txt (file contents):
Revision 1.1 by greg, Sat Oct 22 22:38:10 2011 UTC vs.
Revision 1.8 by greg, Tue Aug 18 19:33:58 2020 UTC

# Line 1 | Line 1
1 < add_executable(pfilt pfilt.c pf2.c pf3.c)
1 > add_executable(pfilt pf2.c pf3.c pfilt.c)
2   target_link_libraries(pfilt rtrad)
3  
4   add_executable(pcond pcond.c pcond2.c pcond3.c pcond4.c warp3d.c)
# Line 45 | Line 45 | target_link_libraries(ra_pict rtrad)
45  
46   add_executable(ra_hexbit ra_hexbit.c)
47   target_link_libraries(ra_hexbit rtrad)
48 +
49   if(X11_FOUND)
50    add_executable(ximage x11image.c x11raster.c clrtab.c)
51    target_link_libraries(ximage rtrad ${X11_LIBRARIES})
52 <  add_executable(xshowtrace xshowtrace.c
53 <    ${CMAKE_CURRENT_SOURCE_DIR}/../common/x11findwind.c)
52 >  add_executable(xshowtrace
53 >    xshowtrace.c
54 >    "${CMAKE_CURRENT_SOURCE_DIR}/../common/x11findwind.c"
55 >  )
56    target_link_libraries(xshowtrace rtrad ${X11_LIBRARIES})
57 <  install(TARGETS ximage xshowtrace RUNTIME DESTINATION bin)
57 >  install(TARGETS ximage xshowtrace
58 >    RUNTIME DESTINATION "bin"
59 >  )
60   endif()
61 +
62   add_executable(pflip pflip.c)
63   target_link_libraries(pflip rtrad)
64  
# Line 74 | Line 80 | target_link_libraries(ra_xyze rtrad)
80   add_executable(macbethcal macbethcal.c pmapgen.c mx3.c warp3d.c)
81   target_link_libraries(macbethcal rtrad)
82  
83 < find_package(TIFF)
83 > add_executable(pmblur2 pmblur2.c)
84 > target_link_libraries(pmblur2 rtrad)
85 >
86 > add_executable(psketch psketch.c)
87 > target_link_libraries(psketch rtrad)
88 >
89 > if(NOT TIFF_LIBRARY)
90 >  find_package(TIFF)
91 > endif()
92   mark_as_advanced(CLEAR TIFF_INCLUDE_DIR TIFF_LIBRARY)
93 +
94 + #special case for manually-built libtiff where find_package fails
95 + if(NOT TIFF_FOUND)
96 +  find_library(TIFF_LIBRARY
97 +    NAMES libtiff.a tiff tiff3 libtiff
98 +    PATHS
99 +      "${CMAKE_CURRENT_SOURCE_DIR}/tiff/libtiff/.libs"
100 +      "${radiance_BINARY_DIR}/Downloads/Source/radiance_support/src/px/tiff/libtiff/.libs"
101 +      "C:/Program Files/GnuWin32/lib"
102 +      "C:/Program Files (x86)/GnuWin32/lib"
103 +  )
104 +  #if we found the library, search for tiff.h in <tiff-lib-dir>/../include
105 +  if(TIFF_LIBRARY)
106 +    get_filename_component(TIFF_LIBRARY_DIR ${TIFF_LIBRARY} PATH)
107 +    set(TIFF_INCLUDE_HINT "${TIFF_LIBRARY_DIR}/../include")
108 +    get_filename_component(TIFF_INCLUDE_HINT "${TIFF_INCLUDE_HINT}" ABSOLUTE)
109 +    find_file(TIFF_HEADER tiff.h PATHS ${TIFF_INCLUDE_HINT})
110 +    mark_as_advanced(TIFF_HEADER)
111 +    if(TIFF_HEADER)
112 +      get_filename_component(TIFF_INCLUDE_DIR "${TIFF_HEADER}" PATH)
113 +      set(TIFF_INCLUDE_DIR "${TIFF_INCLUDE_DIR}" CACHE PATH "Directory containing tiff.h" FORCE)
114 +    endif()
115 +  endif()
116 +
117 +  find_library(Z_LIBRARY z)
118 +  if(TIFF_LIBRARY AND Z_LIBRARY)
119 +    set(TIFF_FOUND TRUE)
120 +    get_filename_component(Z_LIBRARY_RESOLVED ${Z_LIBRARY} REALPATH)
121 +    set(TIFF_LIBRARIES ${TIFF_LIBRARY} ${Z_LIBRARY_RESOLVED})
122 +  else()
123 +    #try find_package again
124 +    #it should succeed now if TIFF_LIBRARY and TIFF_INCLUDE_DIR are set
125 +    find_package(TIFF)
126 +    mark_as_advanced(CLEAR TIFF_INCLUDE_DIR TIFF_LIBRARY)
127 +  endif()
128 + endif()
129 +
130   if(TIFF_FOUND)
131    add_executable(ra_tiff ra_tiff.c)
132    target_link_libraries(ra_tiff rtrad ${TIFF_LIBRARIES})
133 <  install(TARGETS ra_tiff RUNTIME DESTINATION bin)
134 <  install(FILES ${TIFF_LIBRARIES} DESTINATION bin)
133 >  add_executable(normtiff normtiff.c)
134 >  target_link_libraries(normtiff rtrad ${TIFF_LIBRARIES})
135 >  if(BUILD_LIBTIFF)
136 >    add_dependencies(ra_tiff libtiff)
137 >    add_dependencies(normtiff libtiff)
138 >  endif()
139 >  install(TARGETS ra_tiff normtiff
140 >    RUNTIME DESTINATION "bin"
141 >  )
142 >  # install(FILES ${TIFF_LIBRARIES} DESTINATION "bin")
143 >  install(PROGRAMS ran2tiff.csh
144 >    DESTINATION "bin"
145 >    RENAME ran2tiff
146 >  )
147   #TODO: else case
148   endif()
149  
150 < install(TARGETS pfilt pflip ttyimage psign pvalue pcompos protate
151 <  ra_hexbit ra_bmp ra_t8 ra_t16 pcomb pinterp ra_ppm ra_rgbe ra_pict ra_ps
152 <  pextrem ra_gif ra_xyze macbethcal pcond pcwarp
153 <  RUNTIME DESTINATION bin)
150 > install(TARGETS
151 >  macbethcal
152 >  pcomb
153 >  pcompos
154 >  pcond
155 >  pcwarp
156 >  pextrem
157 >  pfilt
158 >  pflip
159 >  pinterp
160 >  pmblur2
161 >  protate
162 >  psign
163 >  psketch
164 >  pvalue
165 >  ra_bmp
166 >  ra_gif
167 >  ra_hexbit
168 >  ra_pict
169 >  ra_ppm
170 >  ra_ps
171 >  ra_rgbe
172 >  ra_t16
173 >  ra_t8
174 >  ra_xyze
175 >  ttyimage
176 >  RUNTIME DESTINATION "bin"
177 > )
178  
179 < install(FILES normpat.csh falsecolor.pl pdfblur.csh pmblur.csh pmdblur.csh
180 <  xyzimage.csh pgblur.csh ra_pfm.csh pbilat.csh
181 <  DESTINATION bin)
179 > if(WIN32)
180 >  add_custom_target(perl ALL
181 >    COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/falsecolor.pl -o
182 >    ${CMAKE_CURRENT_SOURCE_DIR}/falsecolor.exe -d
183 >  )
184 >  add_custom_target(phisto ALL
185 >    COMMAND pp ${CMAKE_CURRENT_SOURCE_DIR}/phisto.pl -o
186 >    ${CMAKE_CURRENT_SOURCE_DIR}/phisto.exe -d
187 >  )
188 >  install(PROGRAMS falsecolor.exe phisto.exe
189 >    DESTINATION "bin"
190 >  )
191 > else()
192 >  install_and_copy_without_extension(
193 >    falsecolor.pl
194 >    normpat.csh
195 >    pbilat.csh
196 >    pdfblur.csh
197 >    pgblur.csh
198 >    phisto.pl
199 >    pmblur.csh
200 >    pmdblur.csh
201 >    ra_pfm.csh
202 >    xyzimage.csh
203 >  )
204 > endif()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines