option( USE_SYSTEM_ELASTIX "Use an installed version of Elastix." OFF )
if( USE_SYSTEM_ELASTIX )
if( NOT EXISTS ${ELASTIX_USE_FILE})
# Expose CMake variable to user
set( ELASTIX_USE_FILE )
# Stop the build
message( FATAL_ERROR "Please point ELASTIX_USE_FILE to your systems UseElastix.cmake file.")
set( ELASTIX_USE_FILE "NOT_FOUND" CACHE PATH "Absolute path to UseElastix.cmake in the root of the elastix build tree.")
message( FATAL_ERROR "Could not find the ELASTIX_USE_FILE (${ELASTIX_USE_FILE}). Use the SuperBuild or manually point the ELASTIX_USE_FILE CMake variable to the UseElastix.cmake file in the root of your elastix build tree.")