forked from Slicer/SlicerGitSVNArchive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExternal_CTKAPPLAUNCHER.cmake
47 lines (40 loc) · 1.69 KB
/
External_CTKAPPLAUNCHER.cmake
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
# 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)
if(Slicer_USE_CTKAPPLAUNCHER)
# Sanity checks
if(DEFINED CTKAPPLAUNCHER_DIR AND NOT EXISTS ${CTKAPPLAUNCHER_DIR})
message(FATAL_ERROR "CTKAPPLAUNCHER_DIR variable is defined but corresponds to non-existing directory")
endif()
# Set dependency list
set(CTKAPPLAUNCHER_DEPENDENCIES "")
# Include dependent projects if any
SlicerMacroCheckExternalProjectDependency(CTKAPPLAUNCHER)
set(proj CTKAPPLAUNCHER)
if(NOT DEFINED CTKAPPLAUNCHER_DIR)
SlicerMacroGetOperatingSystemArchitectureBitness(VAR_PREFIX CTKAPPLAUNCHER)
set(launcher_version "0.1.5")
# On windows, use i386 launcher unconditionally
if("${CTKAPPLAUNCHER_OS}" STREQUAL "win")
set(CTKAPPLAUNCHER_ARCHITECTURE "i386")
endif()
#message(STATUS "${__indent}Adding project ${proj}")
ExternalProject_Add(${proj}
URL http://cloud.github.com/downloads/commontk/AppLauncher/CTKAppLauncher-${launcher_version}-${CTKAPPLAUNCHER_OS}-${CTKAPPLAUNCHER_ARCHITECTURE}.tar.gz
SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj}
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
DEPENDS
${CTKAPPLAUNCHER_DEPENDENCIES}
)
set(CTKAPPLAUNCHER_DIR ${CMAKE_BINARY_DIR}/${proj})
else()
# The project is provided using CTKAPPLAUNCHER_DIR, nevertheless since other
# project may depend on CTKAPPLAUNCHER, let's add an 'empty' one
SlicerMacroEmptyExternalProject(${proj} "${CTKAPPLAUNCHER_DEPENDENCIES}")
endif()
endif()