1# CMake build for libtiff 2# 3# Copyright © 2015 Open Microscopy Environment / University of Dundee 4# Written by Roger Leigh <rleigh@codelibre.net> 5# 6# Permission to use, copy, modify, distribute, and sell this software and 7# its documentation for any purpose is hereby granted without fee, provided 8# that (i) the above copyright notices and this permission notice appear in 9# all copies of the software and related documentation, and (ii) the names of 10# Sam Leffler and Silicon Graphics may not be used in any advertising or 11# publicity relating to the software without the specific, prior written 12# permission of Sam Leffler and Silicon Graphics. 13# 14# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 15# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 16# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 17# 18# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR 19# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, 20# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 21# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 22# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 23# OF THIS SOFTWARE. 24 25extra_dist(Makefile.vc) 26 27include_directories(${PROJECT_SOURCE_DIR}/libtiff 28 ${PROJECT_BINARY_DIR}/libtiff 29 ${PROJECT_SOURCE_DIR}/port 30 ${CMAKE_CURRENT_BINARY_DIR}) 31 32add_executable(fax2ps fax2ps.c) 33target_link_libraries(fax2ps tiff port) 34 35add_executable(fax2tiff fax2tiff.c) 36target_link_libraries(fax2tiff tiff port) 37 38add_executable(pal2rgb pal2rgb.c) 39target_link_libraries(pal2rgb tiff port) 40 41add_executable(ppm2tiff ppm2tiff.c) 42target_link_libraries(ppm2tiff tiff port) 43 44add_executable(raw2tiff raw2tiff.c) 45target_link_libraries(raw2tiff tiff port) 46 47add_executable(rgb2ycbcr rgb2ycbcr.c) 48target_link_libraries(rgb2ycbcr tiff port) 49 50add_executable(thumbnail thumbnail.c) 51target_link_libraries(thumbnail tiff port) 52 53add_executable(tiff2bw tiff2bw.c) 54target_link_libraries(tiff2bw tiff port) 55 56add_executable(tiff2pdf tiff2pdf.c) 57target_link_libraries(tiff2pdf tiff port) 58 59add_executable(tiff2ps tiff2ps.c) 60target_link_libraries(tiff2ps tiff port) 61 62add_executable(tiff2rgba tiff2rgba.c) 63target_link_libraries(tiff2rgba tiff port) 64 65add_executable(tiffcmp tiffcmp.c) 66target_link_libraries(tiffcmp tiff port) 67 68add_executable(tiffcp tiffcp.c) 69target_link_libraries(tiffcp tiff port) 70 71add_executable(tiffcrop tiffcrop.c) 72target_link_libraries(tiffcrop tiff port) 73 74add_executable(tiffdither tiffdither.c) 75target_link_libraries(tiffdither tiff port) 76 77add_executable(tiffdump tiffdump.c) 78target_link_libraries(tiffdump tiff port) 79 80add_executable(tiffinfo tiffinfo.c) 81target_link_libraries(tiffinfo tiff port) 82 83add_executable(tiffmedian tiffmedian.c) 84target_link_libraries(tiffmedian tiff port) 85 86add_executable(tiffset tiffset.c) 87target_link_libraries(tiffset tiff port) 88 89add_executable(tiffsplit tiffsplit.c) 90target_link_libraries(tiffsplit tiff port) 91 92install(TARGETS fax2ps 93 fax2tiff 94 pal2rgb 95 ppm2tiff 96 raw2tiff 97 tiff2bw 98 tiff2pdf 99 tiff2ps 100 tiff2rgba 101 tiffcmp 102 tiffcp 103 tiffcrop 104 tiffdither 105 tiffdump 106 tiffinfo 107 tiffmedian 108 tiffset 109 tiffsplit 110 RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}") 111 112if(HAVE_OPENGL) 113 if(OPENGL_INCLUDE_DIR) 114 include_directories(${OPENGL_INCLUDE_DIR}) 115 endif() 116 if(GLUT_INCLUDE_DIR) 117 include_directories(${GLUT_INCLUDE_DIR}) 118 endif() 119 120 add_executable(tiffgt tiffgt.c) 121 target_link_libraries(tiffgt tiff ${GLUT_LIBRARIES} ${OPENGL_LIBRARIES}) 122 123 install(TARGETS tiffgt 124 RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_BINDIR}") 125endif() 126