Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: itktiff: Update source tree layout to match upstream #4957

Merged
merged 9 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Modules/ThirdParty/TIFF/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ else()
${ITKTIFF_BINARY_DIR}/src
${ITKTIFF_BINARY_DIR}/src/itktiff
${ITKTIFF_SOURCE_DIR}/src
${ITKTIFF_SOURCE_DIR}/src/itktiff
)
set(ITKTIFF_LIBRARIES itktiff)
set(ITK_LIBRARY_PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS FALSE)
Expand Down
35 changes: 35 additions & 0 deletions Modules/ThirdParty/TIFF/UpdateFromUpstream.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash

set -e
set -x
shopt -s dotglob

readonly name="tiff"
readonly ownership="Tiff Upstream <[email protected]>"
readonly subtree="Modules/ThirdParty/TIFF/src/itk$name"
readonly repo="https://gitlab.com/libtiff/libtiff.git"
readonly tag="v4.0.3"
readonly paths="
COPYRIGHT
README

libtiff/libtiff.def
libtiff/libtiff.map
libtiff/tif_config.h.in
libtiff/*.c
libtiff/*.h

port/dummy.c
port/getopt.c
port/libport.h
"

extract_source () {
git_archive
pushd "${extractdir}/${name}-reduced"
echo "* -whitespace" >> .gitattributes
rm -vf libtiff/*.vc.h libtiff/*.wince.h libtiff/mkspans.c libtiff/tif_vms.c libtiff/tif_wince.c
popd
}

. "${BASH_SOURCE%/*}/../../../Utilities/Maintenance/update-third-party.bash"
1 change: 1 addition & 0 deletions Modules/ThirdParty/TIFF/src/itktiff/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* -whitespace
165 changes: 1 addition & 164 deletions Modules/ThirdParty/TIFF/src/itktiff/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,164 +1 @@
project(ITK3P_TIFF)
include_regular_expression("^(itk|tif|fax|port|uv|tconf|t4|mk|itkjpeg|jpeg|mangle|jconfig|jmorecfg).*$")

include_directories(BEFORE ${ITK3P_TIFF_SOURCE_DIR})
include_directories(BEFORE ${ITK3P_TIFF_BINARY_DIR})

# library object files common to compression and decompression
set(common_SRCS
tif_aux.c
tif_close.c
tif_codec.c
tif_compress.c
tif_color.c
tif_dir.c
tif_dirinfo.c
tif_dirread.c
tif_dirwrite.c
tif_dumpmode.c
tif_error.c
tif_extension.c
tif_fax3.c
tif_flush.c
tif_getimage.c
tif_luv.c
tif_lzw.c
tif_next.c
tif_open.c
tif_packbits.c
tif_pixarlog.c
tif_predict.c
tif_print.c
tif_read.c
tif_strip.c
tif_swab.c
tif_tile.c
tif_thunder.c
tif_version.c
tif_warning.c
tif_write.c
tif_zip.c
tif_jpeg.c
)

add_definitions(-DJPEG_SUPPORT -DZIP_SUPPORT -D_HPUX_SOURCE)

if(WIN32)
if(BUILD_SHARED_LIBS)
set(TIFFDLL 1)
else(BUILD_SHARED_LIBS)
set(TIFFSTATIC 1)
endif(BUILD_SHARED_LIBS)
endif(WIN32)

if(BORLAND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w-8004 -w-8057")
endif(BORLAND)

include(TestBigEndian)
include(CheckIncludeFiles)
include(CheckSymbolExists)
include(CheckFunctionExists)

# Check if header file exists and add it to the list.
CHECK_INCLUDE_FILES("assert.h" HAVE_ASSERT_H)
CHECK_INCLUDE_FILES("dlfcn.h" HAVE_DLFCN_H)
CHECK_INCLUDE_FILES("fcntl.h" HAVE_FCNTL_H)
CHECK_INCLUDE_FILES("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES("limits.h" HAVE_LIMITS_H)
CHECK_INCLUDE_FILES("malloc.h" HAVE_MALLOC_H)
CHECK_INCLUDE_FILES("memory.h" HAVE_MEMORY_H)
CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILES("stdlib.h" HAVE_STDLIB_H)
CHECK_INCLUDE_FILES("string.h" HAVE_STRING_H)
CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILES("sys/stat.h" HAVE_SYS_STAT_H)
CHECK_INCLUDE_FILES("sys/time.h" HAVE_SYS_TIME_H)
CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
CHECK_INCLUDE_FILES("windows.h" HAVE_WINDOWS_H)
CHECK_INCLUDE_FILES("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILES("ieeefp.h" HAVE_IEEEFP_H)
CHECK_INCLUDE_FILES("search.h" HAVE_SEARCH_H)


CHECK_FUNCTION_EXISTS(floor HAVE_FLOOR)
CHECK_FUNCTION_EXISTS(getopt HAVE_GETOPT)
CHECK_FUNCTION_EXISTS(isascii HAVE_ISASCII)
CHECK_FUNCTION_EXISTS(memmove HAVE_MEMMOVE)
CHECK_FUNCTION_EXISTS(memset HAVE_MEMSET)
CHECK_FUNCTION_EXISTS(mmap HAVE_MMAP)
CHECK_FUNCTION_EXISTS(pow HAVE_POW)
CHECK_FUNCTION_EXISTS(sqrt HAVE_SQRT)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strchr HAVE_STRCHR)
CHECK_FUNCTION_EXISTS(strrchr HAVE_STRRCHR)
CHECK_FUNCTION_EXISTS(strstr HAVE_STRSTR)
CHECK_FUNCTION_EXISTS(strtol HAVE_STRTOL)
CHECK_FUNCTION_EXISTS(strtoul HAVE_STRTOUL)

include(CheckTypeSize)

CHECK_TYPE_SIZE("int" SIZEOF_INT)
CHECK_TYPE_SIZE("long" SIZEOF_LONG)

TEST_BIG_ENDIAN(WORDS_BIGENDIAN)

configure_file(${ITK3P_TIFF_SOURCE_DIR}/tiffDllConfig.h.in
${ITK3P_TIFF_BINARY_DIR}/itk_tiffDllConfig.h)
configure_file(${ITK3P_TIFF_SOURCE_DIR}/tif_config.h.in
${ITK3P_TIFF_BINARY_DIR}/itk_tif_config.h)

set(MANGLE_PREFIX itk_tiff)
configure_file(${ITK3P_TIFF_SOURCE_DIR}/itk_tiff_mangle.h.in
${ITK3P_TIFF_BINARY_DIR}/itk_tiff_mangle.h
@ONLY)

if(NOT UNIX)
add_definitions( -DTIF_PLATFORM_CONSOLE )
set(common_SRCS ${common_SRCS} tif_win32.c tif_fax3sm.c)
if(BUILD_SHARED_LIBS)
if(NOT BORLAND)
if(NOT MINGW)
set(common_SRCS ${common_SRCS} itktiff.def)
endif(NOT MINGW)
endif(NOT BORLAND)
endif(BUILD_SHARED_LIBS)
else()
set(TIFF_RIGHT_VERSION 1)

set(common_SRCS ${common_SRCS} tif_unix.c tif_fax3sm.c)
if(NOT CMAKE_CROSSCOMPILING)
set_source_files_properties(tif_fax3sm.c GENERATED)
add_executable(itkmkg3states mkg3states.c)
set_property(TARGET itkmkg3states PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
add_custom_command(
COMMAND itkmkg3states -c const ${ITK3P_TIFF_BINARY_DIR}/tif_fax3sm.c
OUTPUT ${ITK3P_TIFF_BINARY_DIR}/tif_fax3sm.c
DEPENDS itkmkg3states
)
endif()
endif()

add_library(itktiff ${common_SRCS})
target_link_libraries(itktiff ${ITKZLIB_LIBRARIES} ${ITKJPEG_LIBRARIES})

if(UNIX)
target_link_libraries(itktiff -lm)
endif(UNIX)

# Apply user-defined properties to the library target.
if(ITK_LIBRARY_PROPERTIES)
set_target_properties(itktiff PROPERTIES ${ITK_LIBRARY_PROPERTIES})
endif(ITK_LIBRARY_PROPERTIES)

install(TARGETS itktiff
EXPORT ${ITK3P_INSTALL_EXPORT_NAME}
RUNTIME DESTINATION ${ITK3P_INSTALL_RUNTIME_DIR} COMPONENT RuntimeLibraries
LIBRARY DESTINATION ${ITK3P_INSTALL_LIBRARY_DIR} COMPONENT RuntimeLibraries
ARCHIVE DESTINATION ${ITK3P_INSTALL_ARCHIVE_DIR} COMPONENT Development
)

if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing")
endif(CMAKE_COMPILER_IS_GNUCXX)
add_subdirectory(libtiff)
12 changes: 6 additions & 6 deletions Modules/ThirdParty/TIFF/src/itktiff/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.

Permission to use, copy, modify, distribute, and sell this software and
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.

THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
16 changes: 8 additions & 8 deletions Modules/ThirdParty/TIFF/src/itktiff/README
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TIFF Software Distribution
--------------------------
This file is just a placeholder; all the documentation is now in
HTML in the html directory. To view the documentation point your
favorite WWW viewer at html/index.html;
favorite WWW viewer at html/index.html;

e.g.

Expand All @@ -24,7 +24,7 @@ want to do is:
% su
# make install

More information, email contacts, and mailing list information can be
More information, email contacts, and mailing list information can be
found online at http://www.remotesensing.org/libtiff/.


Expand All @@ -41,21 +41,21 @@ The legal way of saying that is:
Copyright (c) 1988-1997 Sam Leffler
Copyright (c) 1991-1997 Silicon Graphics, Inc.

Permission to use, copy, modify, distribute, and sell this software and
Permission to use, copy, modify, distribute, and sell this software and
its documentation for any purpose is hereby granted without fee, provided
that (i) the above copyright notices and this permission notice appear in
all copies of the software and related documentation, and (ii) the names of
Sam Leffler and Silicon Graphics may not be used in any advertising or
publicity relating to the software without the specific, prior written
permission of Sam Leffler and Silicon Graphics.

THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
OF THIS SOFTWARE.
1 change: 0 additions & 1 deletion Modules/ThirdParty/TIFF/src/itktiff/RELEASE-DATE

This file was deleted.

1 change: 0 additions & 1 deletion Modules/ThirdParty/TIFF/src/itktiff/VERSION

This file was deleted.

Loading