Skip to content

Commit e40e0b1

Browse files
committed
COMP: Fix macOS packaging ensuring extension has a superbuild layout
This commit is a follow-up of 70d5a3b (Fix extension build on macOS by replacing real Virtual Reality module by a placeholder). Since the extension build-system expects an inner-build directory on all platform, this commit keeps the SuperBuild structure by: - updating "SuperBuildPrerequisites" to list no external project dependencies. - include "VirtualRealityStub" module source in the inner build
1 parent 70d5a3b commit e40e0b1

2 files changed

Lines changed: 24 additions & 13 deletions

File tree

CMakeLists.txt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@ set(EXTENSION_SCREENSHOTURLS "https://www.slicer.org/w/images/4/49/SlicerVirtual
1313
set(EXTENSION_DEPENDS "NA") # Specified as a space separated string, a list or 'NA' if any
1414

1515
#-----------------------------------------------------------------------------
16-
if(APPLE)
17-
# Virtual Reality is not supported on macOS, create an extension that contains a stub module
18-
# that just displays the message that Virtual Reality is not supported. This avoids having
19-
# a build error on the extension build dashboard.
20-
find_package(Slicer REQUIRED)
21-
include(${Slicer_USE_FILE})
22-
add_subdirectory(VirtualRealityStub)
23-
include(${Slicer_EXTENSION_GENERATE_CONFIG})
24-
include(${Slicer_EXTENSION_CPACK})
25-
return()
26-
endif()
27-
#-----------------------------------------------------------------------------
28-
2916
set(EXTENSION_BUILD_SUBDIRECTORY inner-build)
3017

3118
set(SUPERBUILD_TOPLEVEL_PROJECT inner)
@@ -49,6 +36,24 @@ if(${EXTENSION_NAME}_SUPERBUILD)
4936
return()
5037
endif()
5138

39+
#-----------------------------------------------------------------------------
40+
# Virtual Reality is not supported on macOS, create an extension that contains a stub module
41+
# that just displays the message that Virtual Reality is not supported.
42+
# This avoids having a build error on the extension build dashboard.
43+
if(APPLE)
44+
add_subdirectory(VirtualRealityStub)
45+
46+
include(${Slicer_EXTENSION_GENERATE_CONFIG})
47+
48+
set(EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS)
49+
set(${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS "${EXTENSION_CPACK_INSTALL_CMAKE_PROJECTS}" CACHE STRING "List of external projects to install" FORCE)
50+
51+
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_BINARY_DIR};${EXTENSION_NAME};ALL;/")
52+
list(APPEND CPACK_INSTALL_CMAKE_PROJECTS "${${EXTENSION_NAME}_CPACK_INSTALL_CMAKE_PROJECTS}")
53+
include(${Slicer_EXTENSION_CPACK})
54+
return()
55+
endif()
56+
5257
#-----------------------------------------------------------------------------
5358
# Extension modules
5459
add_subdirectory(VirtualReality)

SuperBuildPrerequisites.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ if(DEFINED slicersources_SOURCE_DIR AND NOT DEFINED Slicer_SOURCE_DIR)
99
set(Slicer_SOURCE_DIR ${slicersources_SOURCE_DIR})
1010
endif()
1111

12+
if(APPLE)
13+
set(SlicerVirtualReality_EXTERNAL_PROJECT_DEPENDENCIES "")
14+
message(STATUS "SlicerVirtualReality_EXTERNAL_PROJECT_DEPENDENCIES:${SlicerVirtualReality_EXTERNAL_PROJECT_DEPENDENCIES}")
15+
return()
16+
endif()
17+
1218
# Set list of dependencies to ensure the custom application bundling this
1319
# extension does NOT automatically collect the project list and attempt to
1420
# build external projects associated with VTK modules enabled below.

0 commit comments

Comments
 (0)