1 |
add_executable(pfilt pfilt.c pf2.c pf3.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 |
if(X11_FOUND) |
49 |
add_executable(ximage x11image.c x11raster.c clrtab.c) |
50 |
target_link_libraries(ximage rtrad ${X11_LIBRARIES}) |
51 |
add_executable(xshowtrace xshowtrace.c |
52 |
${CMAKE_CURRENT_SOURCE_DIR}/../common/x11findwind.c) |
53 |
target_link_libraries(xshowtrace rtrad ${X11_LIBRARIES}) |
54 |
install(TARGETS ximage xshowtrace RUNTIME DESTINATION bin) |
55 |
endif() |
56 |
add_executable(pflip pflip.c) |
57 |
target_link_libraries(pflip rtrad) |
58 |
|
59 |
add_executable(protate protate.c) |
60 |
target_link_libraries(protate rtrad) |
61 |
|
62 |
add_executable(pextrem pextrem.c) |
63 |
target_link_libraries(pextrem rtrad) |
64 |
|
65 |
add_executable(pcomb pcomb.c) |
66 |
target_link_libraries(pcomb rtrad) |
67 |
|
68 |
add_executable(pinterp pinterp.c) |
69 |
target_link_libraries(pinterp rtrad) |
70 |
|
71 |
add_executable(ra_xyze ra_xyze.c) |
72 |
target_link_libraries(ra_xyze rtrad) |
73 |
|
74 |
add_executable(macbethcal macbethcal.c pmapgen.c mx3.c warp3d.c) |
75 |
target_link_libraries(macbethcal rtrad) |
76 |
|
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 where find_package fails |
86 |
if(NOT TIFF_FOUND) |
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 |
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 |
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 |
|
124 |
if(TIFF_FOUND) |
125 |
add_executable(ra_tiff ra_tiff.c) |
126 |
target_link_libraries(ra_tiff rtrad ${TIFF_LIBRARIES}) |
127 |
add_executable(normtiff normtiff.c) |
128 |
target_link_libraries(normtiff rtrad ${TIFF_LIBRARIES}) |
129 |
install(TARGETS ra_tiff normtiff RUNTIME DESTINATION bin) |
130 |
install(FILES ${TIFF_LIBRARIES} DESTINATION bin) |
131 |
install(PROGRAMS ran2tiff.csh DESTINATION bin RENAME ran2tiff) |
132 |
#TODO: else case |
133 |
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 psketch |
138 |
RUNTIME DESTINATION bin) |
139 |
|
140 |
if(WIN32) |
141 |
install(PROGRAMS falsecolor.pl DESTINATION bin) |
142 |
else() |
143 |
install(PROGRAMS falsecolor.pl DESTINATION bin RENAME falsecolor) |
144 |
install(PROGRAMS normpat.csh DESTINATION bin RENAME normpat) |
145 |
install(PROGRAMS pdfblur.csh DESTINATION bin RENAME pdfblur) |
146 |
install(PROGRAMS pmblur.csh DESTINATION bin RENAME pmblur) |
147 |
install(PROGRAMS pmdblur.csh DESTINATION bin RENAME pmdblur) |
148 |
install(PROGRAMS xyzimage.csh DESTINATION bin RENAME xyzimage) |
149 |
install(PROGRAMS pgblur.csh DESTINATION bin RENAME pgblur) |
150 |
install(PROGRAMS ra_pfm.csh DESTINATION bin RENAME ra_pfm) |
151 |
install(PROGRAMS pbilat.csh DESTINATION bin RENAME pbilat) |
152 |
install(PROGRAMS phisto.csh DESTINATION bin RENAME phisto) |
153 |
endif() |