set(proj python-numpy) # Set dependency list set(${proj}_DEPENDENCIES python python-pip python-setuptools ) if(NOT DEFINED Slicer_USE_SYSTEM_${proj}) set(Slicer_USE_SYSTEM_${proj} ${Slicer_USE_SYSTEM_python}) endif() # Include dependent projects if any ExternalProject_Include_Dependencies(${proj} PROJECT_VAR proj DEPENDS_VAR ${proj}_DEPENDENCIES) if(Slicer_USE_SYSTEM_${proj}) foreach(module_name IN ITEMS nose numpy ) ExternalProject_FindPythonPackage( MODULE_NAME "${module_name}" REQUIRED ) endforeach() endif() if(NOT Slicer_USE_SYSTEM_${proj}) set(requirements_file ${CMAKE_BINARY_DIR}/${proj}-requirements.txt) file(WRITE ${requirements_file} [===[ nose==1.3.7 --hash=sha256:9ff7c6cc443f8c51994b34a667bbcf45afd6d945be7477b52e97516fd17c53ac # needed for NumPy unit tests # Hashes correspond to the following packages: # - numpy-1.17.3-cp36-cp36m-win_amd64.whl # - numpy-1.17.3-cp36-cp36m-macosx_10_9_x86_64.whl # - numpy-1.17.3-cp36-cp36m-manylinux1_x86_64.whl numpy==1.17.3 --hash=sha256:2e418f0a59473dac424f888dd57e85f77502a593b207809211c76e5396ae4f5c \ --hash=sha256:669795516d62f38845c7033679c648903200980d68935baaa17ac5c7ae03ae0c \ --hash=sha256:4f2a2b279efde194877aff1f76cf61c68e840db242a5c7169f1ff0fd59a2b1e2 ]===]) ExternalProject_Add(${proj} ${${proj}_EP_ARGS} DOWNLOAD_COMMAND "" SOURCE_DIR ${CMAKE_BINARY_DIR}/${proj} BUILD_IN_SOURCE 1 CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND ${PYTHON_EXECUTABLE} -m pip install --require-hashes -r ${requirements_file} LOG_INSTALL 1 DEPENDS ${${proj}_DEPENDENCIES} ) ExternalProject_GenerateProjectDescription_Step(${proj} VERSION ${_version} ) #----------------------------------------------------------------------------- # Sanity checks foreach(varname IN ITEMS python_DIR PYTHON_SITE_PACKAGES_SUBDIR ) if("${${varname}}" STREQUAL "") message(FATAL_ERROR "${varname} CMake variable is expected to be set") endif() endforeach() #----------------------------------------------------------------------------- # Launcher setting specific to build tree set(${proj}_LIBRARY_PATHS_LAUNCHER_BUILD ${python_DIR}/${PYTHON_SITE_PACKAGES_SUBDIR}/numpy/core ${python_DIR}/${PYTHON_SITE_PACKAGES_SUBDIR}/numpy/lib ) mark_as_superbuild( VARS ${proj}_LIBRARY_PATHS_LAUNCHER_BUILD LABELS "LIBRARY_PATHS_LAUNCHER_BUILD" ) #----------------------------------------------------------------------------- # Launcher setting specific to install tree set(${proj}_LIBRARY_PATHS_LAUNCHER_INSTALLED /../lib/Python/${PYTHON_SITE_PACKAGES_SUBDIR}/numpy/core /../lib/Python/${PYTHON_SITE_PACKAGES_SUBDIR}/numpy/lib ) mark_as_superbuild( VARS ${proj}_LIBRARY_PATHS_LAUNCHER_INSTALLED LABELS "LIBRARY_PATHS_LAUNCHER_INSTALLED" ) else() ExternalProject_Add_Empty(${proj} DEPENDS ${${proj}_DEPENDENCIES}) endif()