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.2 by greg, Wed Apr 25 22:21:06 2012 UTC vs.
Revision 1.4 by greg, Tue Aug 29 16:31:32 2017 UTC

# Line 74 | Line 74 | target_link_libraries(ra_xyze rtrad)
74   add_executable(macbethcal macbethcal.c pmapgen.c mx3.c warp3d.c)
75   target_link_libraries(macbethcal rtrad)
76  
77 < find_package(TIFF)
77 > add_executable(psketch psketch.c)
78 > target_link_libraries(psketch rtrad)
79 >
80 > if(NOT TIFF_LIBRARY)
81 >  find_package(TIFF)
82 > endif()
83   mark_as_advanced(CLEAR TIFF_INCLUDE_DIR TIFF_LIBRARY)
84  
85 < #special case for manually built libtiff on Mac where find_package fails
85 > #special case for manually built libtiff where find_package fails
86   if(NOT TIFF_FOUND)
87 <  unset(TIFF_INCLUDE_DIR CACHE)
83 <  find_library(TIFF_LIBRARY tiff
87 >  find_library(TIFF_LIBRARY NAMES libtiff.a tiff tiff3 libtiff
88      PATHS
89        ${CMAKE_CURRENT_SOURCE_DIR}/tiff/libtiff/.libs
90 <      ${radiance_BINARY_DIR}/Downloads/Source/radiance_support/src/px/tiff/libtiff/.libs)
90 >      ${radiance_BINARY_DIR}/Downloads/Source/radiance_support/src/px/tiff/libtiff/.libs
91 >      "C:/Program Files/GnuWin32/lib"
92 >      "C:/Program Files (x86)/GnuWin32/lib"
93 >  )
94 >  #if we found the library, search for tiff.h in <tiff-lib-dir>/../include
95 >  if(TIFF_LIBRARY)
96 >    get_filename_component(TIFF_LIBRARY_DIR ${TIFF_LIBRARY} PATH)
97 >    set(TIFF_INCLUDE_HINT "${TIFF_LIBRARY_DIR}/../include")
98 >    get_filename_component(TIFF_INCLUDE_HINT "${TIFF_INCLUDE_HINT}" ABSOLUTE)
99 >    find_file(TIFF_HEADER tiff.h PATHS ${TIFF_INCLUDE_HINT})
100 >    mark_as_advanced(TIFF_HEADER)
101 >    if(TIFF_HEADER)
102 >      get_filename_component(TIFF_INCLUDE_DIR "${TIFF_HEADER}" PATH)
103 >      set(TIFF_INCLUDE_DIR "${TIFF_INCLUDE_DIR}" CACHE PATH "Directory containing tiff.h" FORCE)
104 >    endif()
105 >  endif()
106 >  #if tiff.h couldn't be found, default to the version in the support tarball
107 >  if(NOT TIFF_INCLUDE_DIR)
108 >    set(TIFF_INCLUDE_DIR "${radiance_BINARY_DIR}/Downloads/Source/radiance_support/src/px/tiff/libtiff" CACHE PATH "Directory containing tiff.h" FORCE)
109 >  endif()
110 >    
111    find_library(Z_LIBRARY z)
112    if(TIFF_LIBRARY AND Z_LIBRARY)
113      set(TIFF_FOUND TRUE)
114 <    set(TIFF_LIBRARIES ${TIFF_LIBRARY} ${Z_LIBRARY})
114 >    get_filename_component(Z_LIBRARY_RESOLVED ${Z_LIBRARY} REALPATH)
115 >    set(TIFF_LIBRARIES ${TIFF_LIBRARY} ${Z_LIBRARY_RESOLVED})
116 >  else()
117 >    #try find_package again
118 >    #it should succeed now if TIFF_LIBRARY and TIFF_INCLUDE_DIR are set
119 >    find_package(TIFF)
120 >    mark_as_advanced(CLEAR TIFF_INCLUDE_DIR TIFF_LIBRARY)
121    endif()
122   endif()
123  
# Line 104 | Line 134 | endif()
134  
135   install(TARGETS pfilt pflip ttyimage psign pvalue pcompos protate
136    ra_hexbit ra_bmp ra_t8 ra_t16 pcomb pinterp ra_ppm ra_rgbe ra_pict ra_ps
137 <  pextrem ra_gif ra_xyze macbethcal pcond pcwarp
137 >  pextrem ra_gif ra_xyze macbethcal pcond pcwarp psketch
138    RUNTIME DESTINATION bin)
139  
140   if(WIN32)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines