-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37380ea
commit 0c70158
Showing
14 changed files
with
193 additions
and
2 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
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#----------------------------------------------------------------------------- | ||
# Git protocol option | ||
#----------------------------------------------------------------------------- | ||
option(Slicer_USE_GIT_PROTOCOL "If behind a firewall turn this off to use http instead." ON) | ||
|
||
set(git_protocol "git") | ||
if(NOT Slicer_USE_GIT_PROTOCOL) | ||
set(git_protocol "http") | ||
endif() | ||
|
||
#----------------------------------------------------------------------------- | ||
# Enable and setup External project global properties | ||
#----------------------------------------------------------------------------- | ||
set(ep_common_c_flags "${CMAKE_C_FLAGS_INIT} ${ADDITIONAL_C_FLAGS}") | ||
set(ep_common_cxx_flags "${CMAKE_CXX_FLAGS_INIT} ${ADDITIONAL_CXX_FLAGS}") | ||
|
||
#----------------------------------------------------------------------------- | ||
# Project dependencies | ||
#----------------------------------------------------------------------------- | ||
include(ExternalProject) | ||
|
||
foreach(dep ${EXTENSION_DEPENDS}) | ||
mark_as_superbuild(${dep}_DIR) | ||
endforeach() | ||
|
||
set(proj ${SUPERBUILD_TOPLEVEL_PROJECT}) | ||
if(UNIX) | ||
set(${proj}_DEPENDS python-collageradiomics) | ||
endif(UNIX) | ||
|
||
ExternalProject_Include_Dependencies(${proj} | ||
PROJECT_VAR proj | ||
SUPERBUILD_VAR ${EXTENSION_NAME}_SUPERBUILD | ||
) | ||
|
||
ExternalProject_Add(${proj} | ||
${${proj}_EP_ARGS} | ||
DOWNLOAD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} | ||
BINARY_DIR ${EXTENSION_BUILD_SUBDIRECTORY} | ||
BUILD_ALWAYS 1 | ||
CMAKE_CACHE_ARGS | ||
-DCMAKE_CXX_COMPILER:FILEPATH=${CMAKE_CXX_COMPILER} | ||
-DCMAKE_CXX_FLAGS:STRING=${ep_common_cxx_flags} | ||
-DCMAKE_C_COMPILER:FILEPATH=${CMAKE_C_COMPILER} | ||
-DCMAKE_C_FLAGS:STRING=${ep_common_c_flags} | ||
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=${CMAKE_OSX_DEPLOYMENT_TARGET} | ||
-DCMAKE_OSX_SYSROOT:PATH=${CMAKE_OSX_SYSROOT} | ||
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} | ||
-DCMAKE_CXX_STANDARD:STRING=${CMAKE_CXX_STANDARD} | ||
-DCMAKE_CXX_STANDARD_REQUIRED:BOOL=${CMAKE_CXX_STANDARD_REQUIRED} | ||
-DCMAKE_CXX_EXTENSIONS:BOOL=${CMAKE_CXX_EXTENSIONS} | ||
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY} | ||
-DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | ||
-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY} | ||
-DSlicer_DIR:PATH=${Slicer_DIR} | ||
-DMIDAS_PACKAGE_EMAIL:STRING=${MIDAS_PACKAGE_EMAIL} | ||
-DMIDAS_PACKAGE_API_KEY:STRING=${MIDAS_PACKAGE_API_KEY} | ||
-D${EXTENSION_NAME}_SUPERBUILD:BOOL=OFF | ||
-DEXTENSION_SUPERBUILD_BINARY_DIR:PATH=${${EXTENSION_NAME}_BINARY_DIR} | ||
-DSubversion_SVN_EXECUTABLE:STRING=${Subversion_SVN_EXECUTABLE} | ||
-DGIT_EXECUTABLE:STRING=${GIT_EXECUTABLE} | ||
DEPENDS | ||
${${proj}_DEPENDS} | ||
) | ||
|
||
ExternalProject_AlwaysConfigure(${proj}) |
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 |
---|---|---|
@@ -0,0 +1,92 @@ | ||
set(proj python-collageradiomics) | ||
|
||
# Set dependency list | ||
set(${proj}_DEPENDENCIES "") | ||
|
||
# Include dependent projects if any | ||
ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj}_DEPENDENCIES) | ||
|
||
if(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}) | ||
ExternalProject_FindPythonPackage( | ||
MODULE_NAME "collageradiomics" | ||
REQUIRED | ||
) | ||
endif() | ||
|
||
if(NOT DEFINED ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}) | ||
set(${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj} ${Slicer_USE_SYSTEM_python}) | ||
endif() | ||
|
||
if(NOT ${CMAKE_PROJECT_NAME}_USE_SYSTEM_${proj}) | ||
|
||
if(NOT DEFINED git_protocol) | ||
set(git_protocol "git") | ||
endif() | ||
|
||
ExternalProject_SetIfNotDefined( | ||
${CMAKE_PROJECT_NAME}_${proj}_GIT_REPOSITORY | ||
"${git_protocol}://github.com/radxtools/collageradiomics" | ||
QUIET | ||
) | ||
|
||
ExternalProject_SetIfNotDefined( | ||
${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG | ||
"origin/master" | ||
QUIET | ||
) | ||
|
||
set(wrapper_script) | ||
if(MSVC) | ||
find_package(Vcvars REQUIRED) | ||
set(wrapper_script ${Vcvars_WRAPPER_BATCH_FILE}) | ||
endif() | ||
|
||
# Alternative python prefix for installing extension python packages | ||
set(python_packages_DIR "${CMAKE_BINARY_DIR}/python-packages-install") | ||
file(TO_NATIVE_PATH ${python_packages_DIR} python_packages_DIR_NATIVE_DIR) | ||
|
||
set(_no_binary "") | ||
|
||
# Install collageradiomics | ||
set(_install_collageradiomics COMMAND ${CMAKE_COMMAND} | ||
-E env | ||
PYTHONNOUSERSITE=1 | ||
CC=${CMAKE_C_COMPILER} | ||
${wrapper_script} ${PYTHON_EXECUTABLE} -m pip install . ${_no_binary} | ||
--prefix ${python_packages_DIR_NATIVE_DIR} | ||
) | ||
|
||
ExternalProject_Add(${proj} | ||
${${proj}_EP_ARGS} | ||
GIT_REPOSITORY "${${CMAKE_PROJECT_NAME}_${proj}_GIT_REPOSITORY}" | ||
GIT_TAG "${${CMAKE_PROJECT_NAME}_${proj}_GIT_TAG}" | ||
SOURCE_DIR ${proj} | ||
BUILD_IN_SOURCE 1 | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND ${CMAKE_COMMAND} -E echo_append "" | ||
${_install_pyyaml} | ||
${_install_collageradiomics} | ||
DEPENDS | ||
${${proj}_DEPENDENCIES} | ||
) | ||
|
||
ExternalProject_GenerateProjectDescription_Step(${proj}) | ||
|
||
#----------------------------------------------------------------------------- | ||
# Launcher setting specific to build tree | ||
set(${proj}_PYTHONPATH_LAUNCHER_BUILD | ||
${python_packages_DIR}/${PYTHON_STDLIB_SUBDIR} | ||
${python_packages_DIR}/${PYTHON_STDLIB_SUBDIR}/lib-dynload | ||
${python_packages_DIR}/${PYTHON_SITE_PACKAGES_SUBDIR} | ||
) | ||
mark_as_superbuild( | ||
VARS ${proj}_PYTHONPATH_LAUNCHER_BUILD | ||
LABELS "PYTHONPATH_LAUNCHER_BUILD" | ||
) | ||
|
||
mark_as_superbuild(python_packages_DIR:PATH) | ||
|
||
else() | ||
ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES}) | ||
endif() |
File renamed without changes
File renamed without changes
File renamed without changes