Blame port/CMakeLists.txt

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