Skip to content

Commit

Permalink
ENH: Trim Python wheel size
Browse files Browse the repository at this point in the history
Only install the Python files and Python C Extension module (it
statically links in elastix libraries) into the Python wheel. This
results in a wheel size reduction by ~80%.
  • Loading branch information
thewtex committed Feb 15, 2023
1 parent ff1a74c commit 9f4a5fe
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ set(BUILD_TESTING ${ELASTIX_BUILD_TESTING})
set(_itk_build_shared ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF) # Elastix does not support shared libs

# Building Python wheels, disable installation of elastix artifacts
if(SKBUILD)
option(ELASTIX_NO_INSTALL_RUNTIME_LIBRARIES "Do not install runtime libraries" ON)
option(ELASTIX_NO_INSTALL_EXECUTABLES "Do not install executables" ON)
option(ELASTIX_NO_INSTALL_DEVELOPMENT "Do not install development headers and static libraries" ON)
mark_as_advanced(ELASTIX_NO_INSTALL_EXECUTABLES ELASTIX_NO_INSTALL_RUNTIME_LIBRARIES ELASTIX_NO_INSTALL_DEVELOPMENT)
endif()

set(elastix_GIT_REPOSITORY "https://github.com/SuperElastix/elastix.git")
set(elastix_GIT_TAG "d652938573e5f193955908eba225a854b31ce36a")
FetchContent_Declare(
Expand Down

0 comments on commit 9f4a5fe

Please sign in to comment.