Skip to content

Instantly share code, notes, and snippets.

@hmaarrfk
Last active June 20, 2018 07:27
Show Gist options
  • Save hmaarrfk/fd590afae2729cdfe685785bfd0fb500 to your computer and use it in GitHub Desktop.
Save hmaarrfk/fd590afae2729cdfe685785bfd0fb500 to your computer and use it in GitHub Desktop.
# - Find an elastix installation or build tree.
# When elastix is found, the ElastixConfig.cmake file is sourced to setup the
# location and configuration of elastix. Please read this file, or
# ElastixConfig.cmake.in from the elastix source tree for the full list of
# definitions. Of particular interest is ELASTIX_USE_FILE, a CMake source file
# that can be included to set the include directories, library directories,
# and preprocessor macros. In addition to the variables read from
# ElastixConfig.cmake, this find module also defines
# Elastix_DIR - The directory containing ElastixConfig.cmake.
# This is either the root of the build tree,
# or the lib/elastix directory.
# This is the only cache entry.
#
# ELASTIX_FOUND - Whether elastix was found. If this is true,
# Elastix_DIR is okay.
#
# USE_ELASTIX_FILE - The full path to the UseElastix.cmake file.
# This is provided for backward
# compatibility. Use ELASTIX_USE_FILE
# instead.
#=============================================================================
# Copyright 2001-2010 Kitware, Inc.
# Copyright 2018 Mark Harfouche
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Use the Config mode of the find_package() command to find ElastixConfig.
# If this succeeds (possibly because Elastix_DIR is already set), the
# command will have already loaded ElastixConfig.cmake and set ELASTIX_FOUND.
if(NOT ELASTIX_FOUND)
set(_ELASTIX_REQUIRED "")
if(ELASTIX_FIND_REQUIRED)
set(_ELASTIX_REQUIRED REQUIRED)
endif()
set(_ELASTIX_QUIET "")
if(ELASTIX_FIND_QUIETLY)
set(_ELASTIX_QUIET QUIET)
endif()
find_package(ELASTIX ${_ELASTIX_REQUIRED} ${_ELASTIX_QUIET} NO_MODULE
NAMES Elastix elastix
CONFIGS ElastixConfig.cmake
)
endif()
if(ELASTIX_FOUND)
# Set USE_ELASTIX_FILE for backward-compatibility.
set(USE_ELASTIX_FILE ${ELASTIX_USE_FILE})
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment