Skip to content

Commit

Permalink
Merge pull request InsightSoftwareConsortium#5022 from blowekamp/gdcm…
Browse files Browse the repository at this point in the history
…_use_itkopenjpeg

GDCM use itkopenjpeg
  • Loading branch information
hjmjohnson authored Dec 7, 2024
2 parents 948e77a + ca64d39 commit 95fdd25
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 2 deletions.
1 change: 1 addition & 0 deletions Modules/ThirdParty/GDCM/itk-module.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ else()
DEPENDS
ITKZLIB
ITKExpat
ITKOpenJPEG
DESCRIPTION
"${DOCUMENTATION}"
)
Expand Down
4 changes: 3 additions & 1 deletion Modules/ThirdParty/GDCM/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ set(GDCM_USE_SYSTEM_EXPAT ON CACHE INTERNAL "")
set(EXPAT_INCLUDE_DIR ${ITKExpat_INCLUDE_DIRS})
set(EXPAT_LIBRARY ${ITKExpat_LIBRARIES})
# OpenJPEG:
set(GDCM_USE_SYSTEM_OPENJPEG OFF CACHE INTERNAL "")
set(GDCM_USE_SYSTEM_OPENJPEG ON CACHE INTERNAL "")
set(GDCM_USE_OPENJPEG_V2 ON CACHE INTERNAL "")
set(OPENJPEG_INCLUDE_DIRS ${ITKOpenJPEG_INCLUDE_DIRS})
set(OPENJPEG_LIBRARIES ${ITKOpenJPEG_LIBRARIES})
# ZLIB:
set(GDCM_USE_SYSTEM_ZLIB ON CACHE INTERNAL "")
set(ZLIB_INCLUDE_DIR ${ITKZLIB_INCLUDE_DIRS})
Expand Down
2 changes: 1 addition & 1 deletion Modules/ThirdParty/GDCM/src/gdcm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ else()
endif()

if(GDCM_USE_SYSTEM_OPENJPEG)
find_package(OpenJPEG 2.0.0 REQUIRED)
#find_package(OpenJPEG REQUIRED)
set(GDCM_OPENJPEG_LIBRARIES ${OPENJPEG_LIBRARIES})
else()
set(GDCM_OPENJPEG_LIBRARIES gdcmopenjp2)
Expand Down
2 changes: 2 additions & 0 deletions Modules/ThirdParty/OpenJPEG/UpdateFromUpstream.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ LICENSE
cmake/EnsureFileInclude.cmake
cmake/TestLargeFiles.cmake
cmake/TestFileOffsetBits.c
cmake/TestLargeFiles.c.cmake.in
src/lib/CMakeLists.txt
src/lib/openjp2/CMakeLists.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <sys/types.h>

/* Cause a compile-time error if off_t is smaller than 64 bits */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];

int main(int argc, char **argv)
{
return 0;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#cmakedefine _LARGEFILE_SOURCE
#cmakedefine _LARGE_FILES
#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
/* Cause a compile-time error if off_t is smaller than 64 bits,
* and make sure we have ftello / fseeko.
*/
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[ (LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1 ];
FILE *fp = fopen(argv[0],"r");
off_t offset = ftello( fp );

fseeko( fp, offset, SEEK_CUR );
fclose(fp);
return 0;
}

0 comments on commit 95fdd25

Please sign in to comment.