File: itk-module-init.cmake

package info (click to toggle)
insighttoolkit5 5.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 704,404 kB
  • sloc: cpp: 783,697; ansic: 628,724; xml: 44,704; fortran: 34,250; python: 22,874; sh: 4,078; pascal: 2,636; lisp: 2,158; makefile: 461; yacc: 328; asm: 205; perl: 203; lex: 146; tcl: 132; javascript: 98; csh: 81
file content (55 lines) | stat: -rw-r--r-- 2,179 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
## Only present and build DCMTK options if ITKIODCMTK is requested

option(ITK_USE_SYSTEM_DCMTK "Use an outside build of DCMTK." OFF)
if(NOT WIN32)
  set(lib_prefix lib)
  if(BUILD_SHARED_LIBS)
    set(lib_suffix "${CMAKE_SHARED_LIBRARY_SUFFIX}")
    set(lib_prefix "${CMAKE_SHARED_LIBRARY_PREFIX}")
  else()
    set(lib_suffix "${CMAKE_STATIC_LIBRARY_SUFFIX}")
    set(lib_prefix "${CMAKE_STATIC_LIBRARY_PREFIX}")
  endif()
else()
  set(lib_prefix "")
  if(BUILD_SHARED_LIBS)
    set(lib_suffix "${CMAKE_IMPORT_LIBRARY_SUFFIX}")
    set(lib_prefix "${CMAKE_IMPORT_LIBRARY_PREFIX}")
  else()
    set(lib_suffix "${CMAKE_STATIC_LIBRARY_SUFFIX}")
    set(lib_prefix "${CMAKE_IMPORT_LIBRARY_PREFIX}")
  endif()
endif()

if(ITK_USE_SYSTEM_DCMTK)
  # Use local FindDCMTK.cmake.
  list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_LIST_DIR}/CMake")
  find_package(DCMTK REQUIRED NO_MODULE)
else(ITK_USE_SYSTEM_DCMTK)
  # Change default from OFF to ON for portability.
  option(DCMTK_ENABLE_BUILTIN_OFICONV_DATA "Embed oficonv data files into oficonv library" ON)
  # Copied and mofified from DCMTK/CMake/3rdparty.cmake
  if(NOT DEFINED DCMTK_USE_ICU)
    include(CheckCXXSourceCompiles)
    check_cxx_source_compiles("#include <iconv.h>\nint main(){iconv_t cd = iconv_open(\"\",\"\");iconv(cd,0,0,0,0);iconv_close(cd);return 0;}" WITH_STDLIBC_ICONV)
    if(WITH_STDLIBC_ICONV)
      message(STATUS "Info: found builtin ICONV support inside the C standard library.")
      set(CHARSET_CONVERSION_ARGS
        -DDCMTK_WITH_STDLIBC_ICONV:BOOL=ON
        -DDCMTK_WITH_ICU:BOOL=OFF
        "-DDCMTK_ENABLE_CHARSET_CONVERSION:STRING=stdlibc (iconv)"
        CACHE INTERNAL "DCMTK Internal arguments"
        )
    endif()
    # ICU creates problems on MacOS and Windows, so by default it is disabled.
    # On Linux, the C standard library can have builtin ICONV support. We
    # disable building ICU by default.
    option(DCMTK_USE_ICU "Downloads and compile ICU for DCMTK" OFF)
  endif()
  if(DCMTK_USE_ICU)
    if(ITK_USE_SYSTEM_ICU)
      find_package(ICU REQUIRED COMPONENTS uc data)
      set(ITKDCMTK_ICU_LIBRARIES ${ICU_LIBRARIES})
    endif()
  endif()
endif(ITK_USE_SYSTEM_DCMTK)