1 # ============================================================================ 2 # Copyright (c) 2011-2012 University of Pennsylvania 3 # Copyright (c) 2013-2016 Andreas Schuh 6 # See COPYING file for license information or visit 7 # https://cmake-basis.github.io/download.html#license 8 # ============================================================================ 10 ############################################################################## 11 # @file BASISUse.cmake 12 # @brief CMake package configuration use file. 14 # @note The BASISUse.cmake file is automatically generated 15 # by BASIS from the template file ConfigUse.cmake.in which is part of 18 # In the default package use file of BASIS, which can be included here using 19 # the \@BASIS_USE\@ variable, the prefix used by the package configuration 20 # file is defined as @c NS variable. Thus, to use any variable set by the 21 # corresponding package configuration file, use code similar to: 24 # include_directories (${${NS}INCLUDE_DIRS}) 27 # See the ConfigUse.cmake.in file of BASIS for details. 29 # @note The CMake code which is substituted for the \@BASIS_USE\@ variable 30 # contains an include guard. 32 # @ingroup BasisConfig 33 ############################################################################## 35 # ============================================================================ 36 # additional BASIS modules 37 # ============================================================================ 39 # The basic tools are included by BASISConfig.cmake already. 40 # Additional modules required by this project are included here. 41 # The include of the ImportTools must occur **before** the include of 42 # the exported CMake BASIS targets itself below. 45 include (${BASIS_MODULE_PATH}/ImportTools.cmake)
47 if (BASIS_SUPER_BUILD_MODULES)
48 include (${BASIS_MODULE_PATH}/SuperBuildTools.cmake)
51 # ============================================================================ 53 # ============================================================================ 55 # ============================================================================ 57 # ============================================================================ 59 # prefix used for variable names 62 # allow caller to change
namespace - used by projects with modules
64 set (
NS "${${NS}CONFIG_PREFIX}_")
67 # ============================================================================ 69 # ============================================================================ 71 if (__${
NS}USE_FILE_INCLUDED)
74 set (__${
NS}USE_FILE_INCLUDED 1)
77 # ============================================================================ 78 # use project settings 79 # ============================================================================ 82 if (${
NS}INCLUDE_DIRS)
84 elseif (${
NS}INCLUDE_DIR)
89 if (${
NS}LIBRARY_DIRS)
95 # ============================================================================ 96 # import build targets 97 # ============================================================================ 99 ## @brief Whether to import the exported targets. 100 set (NO_${
NS}IMPORTS
"${NO_${NS}IMPORTS}")
102 if (NOT NO_${
NS}IMPORTS)
103 include (
"${${NS}EXPORTS_FILE}" OPTIONAL)
104 include (
"${${NS}CUSTOM_EXPORTS_FILE}" OPTIONAL)
107 # ============================================================================ 109 # ============================================================================ 111 foreach (M IN LISTS ${
NS}MODULES_REQUESTED)
112 if (${
NS}${M}_USE_FILE)
113 set (${M}_CONFIG_PREFIX
"${NS}${M}_")
114 include (
"${${NS}${M}_USE_FILE}")
115 unset (${M}_CONFIG_PREFIX)
119 # ============================================================================ 120 # BASIS configuration 121 # ============================================================================ 123 # ---------------------------------------------------------------------------- 124 # Add CMake BASIS Find Modules path to CMAKE_MODULE_PATH 125 list (INSERT CMAKE_MODULE_PATH 0
"${BASIS_FIND_MODULE_PATH}")
126 list (REMOVE_DUPLICATES CMAKE_MODULE_PATH)
128 # ---------------------------------------------------------------------------- 129 # Import configured script executables 131 # The following statements ensure that all scripts and modules are 132 # configured/compiled using the same version of the interpreters. 133 # Yet, the user can modify these variables, though this is not recommended. 135 # Note: The PERL_EXECUTABLE, and BASH_EXECUTABLE variables have to be cached 136 # such that the FindPerl.cmake, and FindBASH.cmake modules find the 137 # respective executable. 139 # Attention: DO NOT set PYTHON_EXECUTABLE here. In case of a Slicer Extension, 140 # the UseSlicer.cmake file requires us not to set PYTHON_EXECUTABLE 141 # before including this file. As the BASISUse.cmake file is included 142 # before any other dependency, the PYTHON_EXECUTABLE variable is 143 # set by the basis_project_impl() macro. 145 ## @brief Jython interpreter configured when building BASIS. 146 if (BASIS_JYTHON_EXECUTABLE)
149 "${BASIS_JYTHON_EXECUTABLE}" 151 "The Jython interpreter." 153 mark_as_advanced (JYTHON_EXECUTABLE)
156 ## @brief Perl interpreter configured when building BASIS. 157 if (BASIS_PERL_EXECUTABLE)
160 "${BASIS_PERL_EXECUTABLE}" 162 "The Perl interpreter." 164 mark_as_advanced (PERL_EXECUTABLE)
167 ## @brief Bash executable configured when building BASIS. 168 if (BASIS_BASH_EXECUTABLE)
171 "${BASIS_BASH_EXECUTABLE}" 173 "The BASH executable." 175 mark_as_advanced (BASH_EXECUTABLE)
cmake LIBRARY_DIR
Directory of shared and module libraries relative to script location.
cmake BASIS_IMPORT_TARGETS
Enable/disable import of targets using the BASIS ImportTools.
macro include_directories(in ARGN)
Add directories to search path for include files.
macro link_directories(in ARGN)
Add directories to search path for libraries.
cmake CONFIG_PREFIX
Package name.