Skip to content

Commit

Permalink
COMP: Unconditionally set wrapped shared lib directory
Browse files Browse the repository at this point in the history
When wrapping for python, the shared library directory
setting must be unconditionally set.  The previous
code would only set the value to the proper
wrapping required directory if the value had
not previously been set.

If WRAP_PYTHON then we must unconditionally set the
CMAKE_LIBRARY_OUTPUT_DIRECTORY to specify the python compatible pathing.

If wrapping for python, then put all the shared libraries (both core
shared libs, and python shared libs in the itk python package
directory under ITK_SWIGLIB_SUBPKG_NAME.
  • Loading branch information
hjmjohnson committed Nov 23, 2020
1 parent 22998bd commit 0428956
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions CMake/ITKModuleExternal.cmake
Expand Up @@ -39,15 +39,18 @@ endif()
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITK_DIR}/bin CACHE PATH "Runtime output directory for ITK")
endif()
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
if(ITK_WRAP_PYTHON)
# If wrapping for python, then put all the shared libraries (both core shared libs,
# and python shared libs in the itk python package directory under swiglib.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ITK_DIR}/Wrapping/Generators/Python/itk/swiglib CACHE PATH "Shared library directory, in wrapped directory.")
else()
if(ITK_WRAP_PYTHON)
# IF WRAP_PYTHON then we must unconditionally set the CMAKE_LIBRARY_OUTPUT_DIRECTORY
# If wrapping for python, then put all the shared libraries (both core shared libs,
# and python shared libs in the itk python package directory under ITK_SWIGLIB_SUBPKG_NAME.
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ITK_DIR}/Wrapping/Generators/Python/itk/${ITK_SWIGLIB_SUBPKG_NAME}" CACHE PATH "Shared library directory, in wrapped directory.")
else()
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ITK_DIR}/lib CACHE PATH "Shared library directory")
endif()
endif()


if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ITK_DIR}/lib CACHE PATH "Static library install directory")
endif()
Expand Down
2 changes: 1 addition & 1 deletion Wrapping/Generators/Python/itk/support/itkBase.py
Expand Up @@ -147,7 +147,7 @@ def itk_load_swig_module(name, namespace=None):

# Get the attribute associated with the class name if it exists
template_container = getattr(
this_module, py_class_name, itkTemplate.itkTemplate(cpp_class_name)
this_module, py_class_name, itkTemplate(cpp_class_name)
)

try:
Expand Down

0 comments on commit 0428956

Please sign in to comment.