~ubuntu-branches/debian/sid/simpleitk/sid

« back to all changes in this revision

Viewing changes to Utilities/Doxygen/ITKDoxygenTags.cmake

  • Committer: Package Import Robot
  • Author(s): Ghislain Antony Vaillant
  • Date: 2017-11-02 08:49:18 UTC
  • Revision ID: package-import@ubuntu.com-20171102084918-7hs09ih668xq87ej
Tags: upstream-1.0.1
ImportĀ upstreamĀ versionĀ 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
# Information on how to retrieve the ITK documentation tag file
 
3
set(ITK_DOXYGEN_TAG_LOCATION "http://public.kitware.com/pub/itk/NightlyDoxygen/InsightDoxygenDocTag.gz")
 
4
set(ITK_DOXYGEN_COMPRESSED_TAG_FILE ${OUTPUT_PATH}/InsightDoxygen.tag.gz)
 
5
set(ITK_DOXYGEN_TAG_FILE ${OUTPUT_PATH}/InsightDoxygen.tag)
 
6
 
 
7
 
 
8
# Get the compressed ITK documentation tag file
 
9
if(NOT EXISTS ${ITK_DOXYGEN_COMPRESSED_TAG_FILE})
 
10
  message("Download ITK tag file")
 
11
  file( DOWNLOAD
 
12
        ${ITK_DOXYGEN_TAG_LOCATION}
 
13
        ${ITK_DOXYGEN_COMPRESSED_TAG_FILE}
 
14
        TIMEOUT 60
 
15
        STATUS statusITKDoxygenTagFile
 
16
        SHOW_PROGRESS )
 
17
  list(GET statusITKDoxygenTagFile 0 statusVal)
 
18
  list(GET statusITKDoxygenTagFile 1 statusMessage)
 
19
  if(statusVal)
 
20
    message(WARNING "Warning: failed to download ITK tag file.")
 
21
    message("Message: " ${statusMessage} )
 
22
    file(REMOVE ${ITK_DOXYGEN_COMPRESSED_TAG_FILE})
 
23
  endif()
 
24
endif(NOT EXISTS ${ITK_DOXYGEN_COMPRESSED_TAG_FILE})
 
25
 
 
26
# Uncompress the ITK tag file
 
27
if(EXISTS ${ITK_DOXYGEN_COMPRESSED_TAG_FILE})
 
28
  find_program(GZIP_TOOL NAMES gzip)
 
29
  if(GZIP_TOOL)
 
30
    message("Decompressing ITK tag file")
 
31
    execute_process(COMMAND ${GZIP_TOOL} -df ${ITK_DOXYGEN_COMPRESSED_TAG_FILE} RESULT_VARIABLE GZIP_OUT)
 
32
    if (${GZIP_OUT} )
 
33
        MESSAGE(WARNING "gzip result message: " ${GZIP_OUT})
 
34
    endif()
 
35
    set(DOXYGEN_TAGFILES_PARAMETER "${ITK_DOXYGEN_TAG_FILE}=https://www.itk.org/Doxygen/html/")
 
36
  endif()
 
37
else()
 
38
  set(DOXYGEN_TAGFILES_PARAMETER "")
 
39
endif()