-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathbootstrap.cmake
30 lines (24 loc) · 1.13 KB
/
bootstrap.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
if(NOT SIPLASPLAS_ROOT)
if(SIPLASPLAS_PACKAGE_URL)
get_filename_component(SIPLASPLAS_PACKAGE "${SIPLASPLAS_PACKAGE_URL}" NAME)
message(STATUS "Downloading siplasplas package (${SIPLASPLAS_PACKAGE}) from ${SIPLASPLAS_PACKAGE_URL} ...")
set(SIPLASPLAS_PACKAGE "${CMAKE_SOURCE_DIR}/${SIPLASPLAS_PACKAGE}")
file(DOWNLOAD "${SIPLASPLAS_PACKAGE_URL}" "${SIPLASPLAS_PACKAGE}" SHOW_PROGRESS)
endif()
if(NOT SIPLASPLAS_PACKAGE OR NOT EXISTS "${SIPLASPLAS_PACKAGE}")
message(FATAL_ERROR "No siplasplas package found")
endif()
get_filename_component(SIPLASPLAS_PACKAGE_NAME "${SIPLASPLAS_PACKAGE}" NAME_WE)
if(NOT EXISTS "${SIPLASPLAS_PACKAGE_NAME}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E tar xvf "${SIPLASPLAS_PACKAGE}"
)
endif()
set(SIPLASPLAS_ROOT "${CMAKE_BINARY_DIR}/${SIPLASPLAS_PACKAGE_NAME}" CACHE INTERNAL "")
endif()
if(EXISTS "${SIPLASPLAS_ROOT}")
list(APPEND CMAKE_MODULE_PATH "${SIPLASPLAS_ROOT}/cmake")
include(siplasplas)
else()
message(FATAL_ERROR "The siplasplas root directory (${SIPLASPLAS_ROOT}) does not exist")
endif()