Skip to content
Open
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
17 changes: 5 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,18 +152,11 @@ endif()
set(EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS)
list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS "${vtkIECTransformLogic_DIR};vtkIECTransformLogic;RuntimeLibraries;/")

# Add optimization runtime libraries if enabled
if(EXTENSION_BUILDS_IPOPT)
if(DEFINED Mumps_DIR AND UNIX)
list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS "${Mumps_DIR};Mumps;RuntimeLibraries;/")
endif()
if(DEFINED HSL_DIR AND UNIX)
list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS "${HSL_DIR};HSL;RuntimeLibraries;/")
endif()
if(DEFINED Ipopt_DIR)
list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS "${Ipopt_DIR};Ipopt;RuntimeLibraries;/")
endif()
endif()
# Note: Mumps/HSL/Ipopt are built via autotools (Unix) or downloaded as a prebuilt zip
# (Windows), so none of them are CMake build trees with a cmake_install.cmake script.
# They cannot be registered via CPACK_INSTALL_CMAKE_PROJECTS (CPack fails trying to run
# a nonexistent install script for them); their runtime files are installed directly by
# the modules that consume them instead (see ExternalBeamPlanning/Widgets/CMakeLists.txt).

if((LINUX OR APPLE) AND EXTENSION_BUILDS_ADAPTIVE_CPP)
list(APPEND EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS "${AdaptiveCpp_DIR};AdaptiveCpp;RuntimeLibraries;/")
Expand Down
8 changes: 8 additions & 0 deletions ExternalBeamPlanning/Widgets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@ if(EXTENSION_BUILDS_IPOPT AND WIN32 AND DEFINED Ipopt_DLL_DIR)
"$<TARGET_FILE_DIR:${KIT}>"
)
endforeach()

# Also install the DLLs for packaging. Ipopt is a prebuilt zip on Windows (not a CMake

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we put this in an if (WIN32)? Not sure if this would break the packaging on Linux

@xskere xskere Jul 2, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's inside if(EXTENSION_BUILDS_IPOPT AND WIN32 AND DEFINED Ipopt_DLL_DIR) so it should be already covered on that. Also I tested build + packaging on both Windows and Linux and it worked fine for both.

# build tree), so it cannot be registered via CPACK_INSTALL_CMAKE_PROJECTS; install it
# as part of this module instead.
install(DIRECTORY "${Ipopt_DLL_DIR}/"
DESTINATION ${Slicer_INSTALL_QTLOADABLEMODULES_BIN_DIR}
COMPONENT RuntimeLibraries
FILES_MATCHING PATTERN "*.dll")
endif()

#-----------------------------------------------------------------------------
Expand Down