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) |
5 |
target_link_libraries(pcond rtrad) |
6 |
|
7 |
add_executable(pcwarp pcwarp.c warp3d.c) |
8 |
target_link_libraries(pcwarp rtrad) |
9 |
|
10 |
add_executable(ttyimage ttyimage.c) |
11 |
target_link_libraries(ttyimage rtrad) |
12 |
|
13 |
add_executable(pvalue pvalue.c) |
14 |
target_link_libraries(pvalue rtrad) |
15 |
|
16 |
add_executable(pcompos pcompos.c) |
17 |
target_link_libraries(pcompos rtrad) |
18 |
|
19 |
add_executable(psign psign.c) |
20 |
target_link_libraries(psign rtrad) |
21 |
|
22 |
add_executable(ra_gif ra_gif.c clrtab.c neuclrtab.c) |
23 |
target_link_libraries(ra_gif rtrad) |
24 |
|
25 |
add_executable(ra_ps ra_ps.c) |
26 |
target_link_libraries(ra_ps rtrad) |
27 |
|
28 |
add_executable(ra_ppm ra_ppm.c) |
29 |
target_link_libraries(ra_ppm rtrad) |
30 |
|
31 |
add_executable(ra_bmp ra_bmp.c) |
32 |
target_link_libraries(ra_bmp rtrad) |
33 |
|
34 |
add_executable(ra_t8 ra_t8.c clrtab.c neuclrtab.c) |
35 |
target_link_libraries(ra_t8 rtrad) |
36 |
|
37 |
add_executable(ra_t16 ra_t16.c) |
38 |
target_link_libraries(ra_t16 rtrad) |
39 |
|
40 |
add_executable(ra_rgbe ra_rgbe.c) |
41 |
target_link_libraries(ra_rgbe rtrad) |
42 |
|
43 |
add_executable(ra_pict ra_pict.c) |
44 |
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 |
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 |
58 |
RUNTIME DESTINATION "bin" |
59 |
) |
60 |
endif() |
61 |
|
62 |
add_executable(pflip pflip.c) |
63 |
target_link_libraries(pflip rtrad) |
64 |
|
65 |
add_executable(protate protate.c) |
66 |
target_link_libraries(protate rtrad) |
67 |
|
68 |
add_executable(pextrem pextrem.c) |
69 |
target_link_libraries(pextrem rtrad) |
70 |
|
71 |
add_executable(pcomb pcomb.c) |
72 |
target_link_libraries(pcomb rtrad) |
73 |
|
74 |
add_executable(pinterp pinterp.c) |
75 |
target_link_libraries(pinterp rtrad) |
76 |
|
77 |
add_executable(ra_xyze ra_xyze.c) |
78 |
target_link_libraries(ra_xyze rtrad) |
79 |
|
80 |
add_executable(macbethcal macbethcal.c pmapgen.c mx3.c warp3d.c) |
81 |
target_link_libraries(macbethcal rtrad) |
82 |
|
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 |
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 |
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 |
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() |