comparison Resources/CMake/GdcmConfiguration.cmake @ 177:8d1b1dc6150b

upgrade to GDCM 2.8.4 for static builds
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 Jan 2018 09:21:52 +0100
parents 55f8cf4ea237
children 993dd140bd30
comparison
equal deleted inserted replaced
176:55f8cf4ea237 177:8d1b1dc6150b
45 45
46 if (CMAKE_TOOLCHAIN_FILE) 46 if (CMAKE_TOOLCHAIN_FILE)
47 list(APPEND Flags -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) 47 list(APPEND Flags -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE})
48 endif() 48 endif()
49 49
50 # Don't build manpages (since gdcm 2.8.4)
51 list(APPEND Flags -DGDCM_BUILD_DOCBOOK_MANPAGES=OFF)
52
50 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase") 53 if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
51 # Trick to disable the compilation of socket++ by gdcm, which is 54 # Trick to disable the compilation of socket++ by gdcm, which is
52 # incompatible with LSB, but fortunately only required for DICOM 55 # incompatible with LSB, but fortunately only required for DICOM
53 # Networking 56 # Networking
54 list(APPEND Flags -DGDCM_USE_SYSTEM_SOCKETXX=ON) 57 list(APPEND Flags -DGDCM_USE_SYSTEM_SOCKETXX=ON)
55 58
56 # Detect the number of CPU cores 59 # Detect the number of CPU cores to run "make" with as much
60 # parallelism as possible
57 include(ProcessorCount) 61 include(ProcessorCount)
58 ProcessorCount(N) 62 ProcessorCount(N)
59 if (NOT N EQUAL 0) 63 if (NOT N EQUAL 0)
60 set(MAKE_PARALLEL -j${N}) 64 set(MAKE_PARALLEL -j${N})
61 endif() 65 endif()
62 66
63 # For Linux Standard Base, avoid building incompatible target gdcmMEXD (*) 67 # For Linux Standard Base, avoid building incompatible target gdcmMEXD (*)
64 set(BUILD_COMMAND BUILD_COMMAND 68 set(BUILD_COMMAND BUILD_COMMAND
65 ${CMAKE_MAKE_PROGRAM} ${MAKE_PARALLEL} 69 ${CMAKE_MAKE_PROGRAM} ${MAKE_PARALLEL}
66 gdcmMSFF gdcmcharls gdcmDICT gdcmDSED gdcmIOD gdcmjpeg8 70 gdcmMSFF gdcmcharls gdcmDICT gdcmDSED gdcmIOD gdcmjpeg8
67 gdcmjpeg12 gdcmjpeg16 gdcmopenjpeg gdcmzlib gdcmCommon gdcmexpat) 71 gdcmjpeg12 gdcmjpeg16 gdcmopenjp2 gdcmzlib gdcmCommon gdcmexpat)
68 endif() 72 endif()
69 73
70 include(ExternalProject) 74 include(ExternalProject)
71 externalproject_add(GDCM 75 externalproject_add(GDCM
72 URL "http://www.orthanc-server.com/downloads/third-party/gdcm-2.6.0.tar.gz" 76 URL "http://www.orthanc-server.com/downloads/third-party/gdcm-2.8.4.tar.gz"
73 URL_MD5 "978afe57af448b1c97c9f116790aca9c" 77 URL_MD5 "ce957b0bc1be4e8019162a10ca15432f"
74 TIMEOUT 60 78 TIMEOUT 60
75 CMAKE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} ${Flags} 79 CMAKE_ARGS -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} ${Flags}
76 ${BUILD_COMMAND} # Customize "make", only for Linux Standard Base (*) 80 ${BUILD_COMMAND} # Customize "make", only for Linux Standard Base (*)
77 INSTALL_COMMAND "" # Skip the install step 81 INSTALL_COMMAND "" # Skip the install step
78 ) 82 )
83 else() 87 else()
84 set(Suffix ".a") 88 set(Suffix ".a")
85 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) 89 list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix)
86 endif() 90 endif()
87 91
88 set(GDCM_LIBRARIES 92 set(GDCM_LIBRARIES
93 # WARNING: The order of the libraries below *is* important!
89 ${Prefix}gdcmMSFF${Suffix} 94 ${Prefix}gdcmMSFF${Suffix}
90 ${Prefix}gdcmcharls${Suffix} 95 ${Prefix}gdcmcharls${Suffix}
91 ${Prefix}gdcmDICT${Suffix} 96 ${Prefix}gdcmDICT${Suffix}
92 ${Prefix}gdcmDSED${Suffix} 97 ${Prefix}gdcmDSED${Suffix}
93 ${Prefix}gdcmIOD${Suffix} 98 ${Prefix}gdcmIOD${Suffix}
94 ${Prefix}gdcmjpeg8${Suffix} 99 ${Prefix}gdcmjpeg8${Suffix}
95 ${Prefix}gdcmjpeg12${Suffix} 100 ${Prefix}gdcmjpeg12${Suffix}
96 ${Prefix}gdcmjpeg16${Suffix} 101 ${Prefix}gdcmjpeg16${Suffix}
97 ${Prefix}gdcmopenjpeg${Suffix} 102 ${Prefix}gdcmopenjp2${Suffix}
98 ${Prefix}gdcmzlib${Suffix} 103 ${Prefix}gdcmzlib${Suffix}
99 ${Prefix}gdcmCommon${Suffix} 104 ${Prefix}gdcmCommon${Suffix}
100 ${Prefix}gdcmexpat${Suffix} 105 ${Prefix}gdcmexpat${Suffix}
101 106
102 #${Prefix}socketxx${Suffix} 107 #${Prefix}socketxx${Suffix}