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