External_SlicerWebGLExport.cmake 1.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Make sure this file is included only once
get_filename_component(CMAKE_CURRENT_LIST_FILENAME ${CMAKE_CURRENT_LIST_FILE} NAME_WE)
if(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED)
  return()
endif()
set(${CMAKE_CURRENT_LIST_FILENAME}_FILE_INCLUDED 1)

# Sanity checks
if(DEFINED SlicerWebGLExport_SOURCE_DIR AND NOT EXISTS ${SlicerWebGLExport_SOURCE_DIR})
  message(FATAL_ERROR "SlicerWebGLExport_SOURCE_DIR variable is defined but corresponds to non-existing directory")
endif()

# Set dependency list
set(SlicerWebGLExport_DEPENDENCIES "")

# Include dependent projects if any
SlicerMacroCheckExternalProjectDependency(SlicerWebGLExport)
set(proj SlicerWebGLExport)

if(NOT DEFINED SlicerWebGLExport_SOURCE_DIR)
  #message(STATUS "${__indent}Adding project ${proj}")
  ExternalProject_Add(${proj}
    GIT_REPOSITORY "${git_protocol}://github.com/xtk/SlicerWebGLExport.git"
24
    GIT_TAG "9e6b567f1ed6c005fb91a815ed00c20d2e13df78"
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
    SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
    BINARY_DIR ${proj}-build
    UPDATE_COMMAND ""
    CMAKE_GENERATOR ${gen}
    CONFIGURE_COMMAND ""
    BUILD_COMMAND ""
    INSTALL_COMMAND ""
    DEPENDS
      ${SlicerWebGLExport_DEPENDENCIES}
    )
  set(SlicerWebGLExport_SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}/WebGLExport)
else()
  # The project is provided using SlicerWebGLExport_SOURCE_DIR, nevertheless since other project may depend on SlicerWebGLExport,
  # let's add an 'empty' one
  SlicerMacroEmptyExternalProject(${proj} "${SlicerWebGLExport_DEPENDENCIES}")
endif()