File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -328,3 +328,37 @@ ExternalProject_Add_Step(${proj} forcebuild
328328 DEPENDERS build
329329 ALWAYS 1
330330 )
331+
332+ # -------------------------------------------------------------------------
333+ # Superbuild install: delegate to inner ANTS-build
334+ # -------------------------------------------------------------------------
335+
336+ set (_inner_build_dir "${CMAKE_BINARY_DIR} /${LOCAL_PROJECT_NAME} -build" )
337+
338+ # Create a harmless stamp so the superbuild has an install script
339+ set (_superbuild_stamp "${CMAKE_CURRENT_BINARY_DIR} /superbuild-install-stamp.txt" )
340+ file (WRITE "${_superbuild_stamp} " "ANTs superbuild install stamp\n " )
341+ install (FILES "${_superbuild_stamp} " DESTINATION "share/ANTs" COMPONENT Superbuild)
342+
343+ # Delegate install to the inner build tree (and build it first for cmake --install)
344+ install (CODE
345+ "
346+ message(STATUS \" Superbuild: building ${LOCAL_PROJECT_NAME} target before install\" )
347+ execute_process(
348+ COMMAND \" ${CMAKE_COMMAND} \" --build \" ${CMAKE_BINARY_DIR} \" --target \" ${LOCAL_PROJECT_NAME} \"
349+ RESULT_VARIABLE _bres
350+ )
351+ if(NOT _bres EQUAL 0)
352+ message(FATAL_ERROR \" Superbuild build of ${LOCAL_PROJECT_NAME} failed with exit code: \$ {_bres}\" )
353+ endif()
354+
355+ message(STATUS \" Superbuild: installing from inner build dir: ${_inner_build_dir} \" )
356+ execute_process(
357+ COMMAND \" ${CMAKE_COMMAND} \" --install \" ${_inner_build_dir} \" --prefix \" ${CMAKE_INSTALL_PREFIX} \"
358+ RESULT_VARIABLE _res
359+ )
360+ if(NOT _res EQUAL 0)
361+ message(FATAL_ERROR \" Inner ${LOCAL_PROJECT_NAME} install failed with exit code: \$ {_res}\" )
362+ endif()
363+ "
364+ )
You can’t perform that action at this time.
0 commit comments