Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 7 additions & 44 deletions CMake/ITKModuleExternal.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -75,55 +75,18 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR "lib")
endif()

# The default path when not wrapping. Restore standard build location
# if python wrapping is turned on, and then turned off.
# When Wrapping is enabled the CMAKE_*_OUTPUT_DIRECTORY(s) will be explicitly set
include(WrappingConfigCommon)

# Only set default if not prior configured by wrapping or the user
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(
NO_WRAP_CMAKE_LIBRARY_OUTPUT_DIRECTORY
${ITK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
CACHE PATH
"Shared library directory"
)
else()
set(
NO_WRAP_CMAKE_LIBRARY_OUTPUT_DIRECTORY
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
CACHE PATH
"Shared library directory"
)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(
NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY
${ITK_BINARY_DIR}/bin
CACHE PATH
"Shared library directory"
)
else()
set(
NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
CACHE PATH
"Shared library directory"
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/bin)
endif()

include(WrappingConfigCommon)
# Setup build locations for shared libraries ----STOP

if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(
CMAKE_ARCHIVE_OUTPUT_DIRECTORY
${ITK_DIR}/${CMAKE_INSTALL_LIBDIR}
CACHE PATH
"Static library install directory"
)
set(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
CACHE PATH
"Runtime library directory"
)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
endif()

# ITK installation structure
Expand Down
38 changes: 3 additions & 35 deletions CMake/WrappingConfigCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,40 +41,8 @@ if(ITK_WRAPPING)
# When wrapping, the multi-config generators can only be used in degraded state
# of allowing only a single element int the CMAKE_CONFIGURATION_TYPES and enforcing
# that CMAKE_BUILD_TYPE match that type (see Wrapping/CMakeLists.txt enforcement)
set(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
"$<1:${ITK_PYTHON_PACKAGE_DIR}>"
CACHE PATH
"Shared library directory with generator override"
FORCE
)
set(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
"$<1:${ITK_PYTHON_PACKAGE_DIR}>"
CACHE PATH
"Shared library directory with generator override"
FORCE
)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "$<1:${ITK_PYTHON_PACKAGE_DIR}>")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "$<1:${ITK_PYTHON_PACKAGE_DIR}>")
endif()
else()
set(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
${NO_WRAP_CMAKE_LIBRARY_OUTPUT_DIRECTORY}
CACHE PATH
"Shared library directory"
)
set(
CMAKE_RUNTIME_OUTPUT_DIRECTORY
${NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY}
CACHE PATH
"Runtime library directory"
)
endif()
mark_as_advanced(
FORCE
CMAKE_RUNTIME_OUTPUT_DIRECTORY
CMAKE_LIBRARY_OUTPUT_DIRECTORY
NO_WRAP_CMAKE_LIBRARY_OUTPUT_DIRECTORY
NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY
Python3_ROOT_DIR
)
mark_as_advanced(FORCE Python3_ROOT_DIR)
45 changes: 10 additions & 35 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,44 +345,22 @@ if(NOT DEFINED CMAKE_FIND_USE_PACKAGE_REGISTRY)
set(CMAKE_FIND_USE_PACKAGE_REGISTRY 0)
endif()

# Setup build locations for shared libraries ----START
# ITK/CMakeLists.txt -- use ITK_BINARY_DIR as root
# ITK/CMake/ITKModuleExternal.cmake -- use ITK_DIR as root
# Setup build locations for libraries ----START
#
# The default path when not wrapping. Restore standard build location
# if python wrapping is turned on, and then turned off.
# When Wrapping is enabled the CMAKE_*_OUTPUT_DIRECTORY(s) will be explicitly set
include(WrappingConfigCommon)

# Only set default is not prior configured by wrapping or the user
if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(
NO_WRAP_CMAKE_LIBRARY_OUTPUT_DIRECTORY
${ITK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}
CACHE PATH
"Shared library directory"
)
else()
set(
NO_WRAP_CMAKE_LIBRARY_OUTPUT_DIRECTORY
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
CACHE PATH
"Shared library directory"
)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
endif()
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(
NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY
${ITK_BINARY_DIR}/bin
CACHE PATH
"Shared library directory"
)
else()
set(
NO_WRAP_CMAKE_RUNTIME_OUTPUT_DIRECTORY
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
CACHE PATH
"Shared library directory"
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/bin)
endif()
if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
endif()

include(WrappingConfigCommon)
# Setup build locations for shared libraries ----STOP

if(CMAKE_CONFIGURATION_TYPES AND ITK_WRAPPING)
Expand All @@ -399,9 +377,6 @@ if(CMAKE_CONFIGURATION_TYPES AND ITK_WRAPPING)
)
endif()

if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ITK_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
endif()
set(ITK_MODULES_DIR "${ITK_BINARY_DIR}/${ITK_INSTALL_PACKAGE_DIR}/Modules")

#-----------------------------------------------------------------------------
Expand Down
21 changes: 2 additions & 19 deletions Wrapping/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,8 @@ set(
)

if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
# See ITK/CMakeLists.txt for rational for overwriting multi-config default behavior of appending $<CONFIG>
set(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
"$<1:${WrapITK_BINARY_DIR}/lib>"
CACHE INTERNAL
"Single output directory for building all libraries."
)
endif()

if(NOT EXECUTABLE_OUTPUT_PATH)
set(
EXECUTABLE_OUTPUT_PATH
${WrapITK_BINARY_DIR}/bin
CACHE INTERNAL
"Single output directory for building all executables."
)
# See ITK/WrappingConfigCommon.cmake for rational for overwriting multi-config default behavior of appending $<CONFIG>
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "$<1:${WrapITK_BINARY_DIR}/lib>")
endif()

# Set WRAP_ITK_INSTALL_COMPONENT_IDENTIFIER to a non-null value, like
Expand All @@ -97,12 +83,9 @@ endif()

mark_as_advanced(
CMAKE_LIBRARY_OUTPUT_DIRECTORY
EXECUTABLE_OUTPUT_PATH
WRAP_ITK_INSTALL_PREFIX
)

set(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})

###############################################################################
# Additional files for installation
###############################################################################
Expand Down
Loading