Blame port/CMakeLists.txt

Packit Service 2594b8
# CMake build for libtiff
Packit Service 2594b8
#
Packit Service 2594b8
# Copyright © 2015 Open Microscopy Environment / University of Dundee
Packit Service 2594b8
# Written by Roger Leigh <rleigh@codelibre.net>
Packit Service 2594b8
#
Packit Service 2594b8
# Permission to use, copy, modify, distribute, and sell this software and
Packit Service 2594b8
# its documentation for any purpose is hereby granted without fee, provided
Packit Service 2594b8
# that (i) the above copyright notices and this permission notice appear in
Packit Service 2594b8
# all copies of the software and related documentation, and (ii) the names of
Packit Service 2594b8
# Sam Leffler and Silicon Graphics may not be used in any advertising or
Packit Service 2594b8
# publicity relating to the software without the specific, prior written
Packit Service 2594b8
# permission of Sam Leffler and Silicon Graphics.
Packit Service 2594b8
#
Packit Service 2594b8
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
Packit Service 2594b8
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
Packit Service 2594b8
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Packit Service 2594b8
#
Packit Service 2594b8
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
Packit Service 2594b8
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
Packit Service 2594b8
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
Packit Service 2594b8
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
Packit Service 2594b8
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
Packit Service 2594b8
# OF THIS SOFTWARE.
Packit Service 2594b8
Packit Service 2594b8
set(port_HEADERS libport.h)
Packit Service 2594b8
set(port_SOURCES dummy.c)
Packit Service 2594b8
set(port_optional_SOURCES
Packit Service 2594b8
  getopt.c
Packit Service 2594b8
  lfind.c
Packit Service 2594b8
  strcasecmp.c
Packit Service 2594b8
  strtoul.c
Packit Service 2594b8
  strtoull.c)
Packit Service 2594b8
Packit Service 2594b8
set(port_USED_FILES ${port_SOURCES} ${port_HEADERS})
Packit Service 2594b8
Packit Service 2594b8
if(NOT HAVE_GETOPT)
Packit Service 2594b8
  list(APPEND port_USED_FILES getopt.c)
Packit Service 2594b8
endif()
Packit Service 2594b8
if(NOT HAVE_LFIND)
Packit Service 2594b8
  list(APPEND port_USED_FILES lfind.c)
Packit Service 2594b8
endif()
Packit Service 2594b8
if(MSVC AND NOT HAVE_SNPRINTF)
Packit Service 2594b8
  list(APPEND port_USED_FILES snprintf.c)
Packit Service 2594b8
endif()
Packit Service 2594b8
if(NOT HAVE_STRCASECMP)
Packit Service 2594b8
  list(APPEND port_USED_FILES strcasecmp.c)
Packit Service 2594b8
endif()
Packit Service 2594b8
if(NOT HAVE_STRTOUL)
Packit Service 2594b8
  list(APPEND port_USED_FILES strtoul.c)
Packit Service 2594b8
endif()
Packit Service 2594b8
if(NOT HAVE_STRTOULL)
Packit Service 2594b8
  list(APPEND port_USED_FILES strtoull.c)
Packit Service 2594b8
endif()
Packit Service 2594b8
Packit Service 2594b8
add_library(port STATIC ${port_USED_FILES})
Packit Service 2594b8
Packit Service 2594b8
foreach(file ${port_USED_FILES})
Packit Service 2594b8
  list(APPEND tiff_port_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/${file}")
Packit Service 2594b8
endforeach()
Packit Service 2594b8
set(tiff_port_SOURCES ${tiff_port_SOURCES} PARENT_SCOPE)