-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DrawEM_BUILD_N4 and DrawEM_ATLASES options, use ExternalProject_A…
…dd_Step to move extracted folder
- Loading branch information
Showing
2 changed files
with
31 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,31 @@ | ||
cmake_minimum_required(VERSION 2.7) | ||
set(ATLASES_URL "https://biomedic.doc.ic.ac.uk/brain-development/downloads/dHCP/atlases-dhcp-structural-pipeline-v1.zip") | ||
set(ATLASES_MD5 "77e924bc17a4906f5814874009f5eca6") | ||
set(ATLASES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/atlases") | ||
|
||
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) | ||
set(_default ON) | ||
if (IS_DIRECTORY "${ATLASES_DIR}") | ||
set(_default OFF) | ||
endif () | ||
option(DrawEM_ATLASES "Whether to download DrawEM atlases during build step" ${_default}) | ||
unset(_default) | ||
|
||
set(ATLAS_URL "https://biomedic.doc.ic.ac.uk/brain-development/downloads/dHCP/atlases-dhcp-structural-pipeline-v1.zip") | ||
set(ATLAS_MD5 77e924bc17a4906f5814874009f5eca6) | ||
if (DrawEM_ATLASES) | ||
|
||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/atlases) | ||
ExternalProject_Add(atlases | ||
URL ${ATLAS_URL} | ||
URL_MD5 ${ATLAS_MD5} | ||
PREFIX atlases | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
) | ||
include(ExternalProject) | ||
|
||
add_custom_target(atlases_move ALL | ||
${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/atlases/src/atlases ${CMAKE_CURRENT_SOURCE_DIR}/atlases | ||
) | ||
ExternalProject_Add(atlases | ||
URL ${ATLASES_URL} | ||
URL_MD5 ${ATLASES_MD5} | ||
PREFIX atlases | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
) | ||
|
||
ADD_DEPENDENCIES(atlases_move atlases) | ||
endif() | ||
ExternalProject_Add_Step(atlases rename | ||
COMMAND ${CMAKE_COMMAND} -E rename "${CMAKE_CURRENT_BINARY_DIR}/atlases/src/atlases" "${ATLASES_DIR}" | ||
COMMENT "Move extracted atlases to source directory" | ||
DEPENDEES download | ||
) | ||
|
||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters