Go to the documentation of this file.00001 ##############################################################################
00002 # @file BASISUse.cmake
00003 # @brief CMake package configuration use file.
00004 #
00005 # @note The BASISUse.cmake file is automatically generated
00006 # by BASIS from the template file ConfigUse.cmake.in which is part of
00007 # this package.
00008 #
00009 # In the default package use file of BASIS, which can be included here using
00010 # the \@BASIS_USE\@ variable, the prefix used by the package configuration
00011 # file is defined as @c NS variable. Thus, to use any variable set by the
00012 # corresponding package configuration file, use code similar to:
00013 #
00014 # @code
00015 # include_directories (${${NS}INCLUDE_DIRS})
00016 # @endcode
00017 #
00018 # See the ConfigUse.cmake.in file of BASIS for details.
00019 #
00020 # @note The CMake code which is substituted for the \@BASIS_USE\@ variable
00021 # contains an include guard.
00022 #
00023 # Copyright (c) 2012 University of Pennsylvania. All rights reserved.<br />
00024 # See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
00025 #
00026 # Contact: SBIA Group <sbia-software at uphs.upenn.edu>
00027 #
00028 # @ingroup BasisConfig
00029 ##############################################################################
00030
00031 # ============================================================================
00032 # namespace
00033 # ============================================================================
00034
00035 # prefix used for variable names
00036 set (NS "BASIS_")
00037
00038 # allow caller to change namespace - used by projects with modules
00039 if (${NS}CONFIG_PREFIX)
00040 set (NS "${${NS}CONFIG_PREFIX}")
00041 endif ()
00042
00043 # ============================================================================
00044 # include guard
00045 # ============================================================================
00046
00047 if (__${NS}USE_FILE_INCLUDED)
00048 return ()
00049 else ()
00050 set (__${NS}USE_FILE_INCLUDED 1)
00051 endif ()
00052
00053 # ============================================================================
00054 # use project settings
00055 # ============================================================================
00056
00057 # include directories
00058 if (${NS}INCLUDE_DIRS)
00059 include_directories (${${NS}INCLUDE_DIRS})
00060 elseif (${NS}INCLUDE_DIR)
00061 include_directories (${${NS}INCLUDE_DIR})
00062 endif ()
00063
00064 # library directories
00065 if (${NS}LIBRARY_DIRS)
00066 link_directories (${${NS}LIBRARY_DIRS})
00067 elseif (${NS}LIBRARY_DIR)
00068 link_directories (${${NS}LIBRARY_DIR})
00069 endif ()
00070
00071 # ============================================================================
00072 # import build targets
00073 # ============================================================================
00074
00075 ## @brief Whether to import the exported targets.
00076 set (NO_BASIS_IMPORTS "${NO_BASIS_IMPORTS}")
00077
00078 if (NOT NO_BASIS_IMPORTS)
00079 include ("${CMAKE_CURRENT_LIST_DIR}/BASISExports.cmake" OPTIONAL)
00080 include ("${CMAKE_CURRENT_LIST_DIR}/BASISCustomExports.cmake" OPTIONAL)
00081 endif ()
00082
00083 # ============================================================================
00084 # use modules
00085 # ============================================================================
00086
00087 # following statements only valid for top-level projects, not modules
00088 if (NOT FALSE)
00089 foreach (M IN LISTS ${NS}MODULES_REQUESTED)
00090 if (${NS}${M}_USE_FILE)
00091 set (${M}_CONFIG_PREFIX "${NS}${M}_")
00092 include ("${${NS}${M}_USE_FILE}")
00093 unset (${M}_CONFIG_PREFIX)
00094 endif ()
00095 endforeach ()
00096 endif ()
00097
00098 # ============================================================================
00099 # BASIS configuration
00100 # ============================================================================
00101
00102 # The following statements ensure that all Perl/Python scripts and modules
00103 # are configured/compiled using the same version of the interpreter to
00104 # avoid incompatibilities.
00105
00106 # Note: The PYTHON_EXECUTABLE, PERL_EXECUTABLE, and BASH_EXECUTABLE variables
00107 # have to be cached such that the FindPythonInterpr.cmake, FindPerl.cmake,
00108 # and FindBASH.cmake modules find the respective executable.
00109
00110 ## @brief Python interpreter configured when building BASIS.
00111 set (
00112 PYTHON_EXECUTABLE
00113 "${BASIS_PYTHON_EXECUTABLE}"
00114 CACHE INTERNAL
00115 "The Python interpreter."
00116 FORCE
00117 )
00118
00119 ## @brief Perl interpreter configured when building BASIS.
00120 set (
00121 PERL_EXECUTABLE
00122 "${BASIS_PERL_EXECUTABLE}"
00123 CACHE INTERNAL
00124 "The Perl interpreter."
00125 FORCE
00126 )
00127
00128 ## @brief BASH executable configured when building BASIS.
00129 set (
00130 BASH_EXECUTABLE
00131 "${BASIS_BASH_EXECUTABLE}"
00132 CACHE INTERNAL
00133 "The BASH executable."
00134 FORCE
00135 )