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 BASISConfig.cmake 12 # @brief CMake package configuration file. 14 # @note The BASISConfig.cmake file is automatically generated 15 # by BASIS from the template file Config.cmake.in which is part of 18 # Variables in this file have to be prefixed by the name of this package. 19 # In the default package configuration file of BASIS, which can be included 20 # here using the \@BASIS_CONFIG\@ variable, this prefix is defined as @c NS 21 # variable. Moreover, the macro basis_set_config() should be used for 22 # convenience to set any configuration variable, e.g., 25 # basis_set_config (INCLUDE_DIR "\@INCLUDE_DIR_CONFIG\@") 28 # where the variable @c INCLUDE_DIR_CONFIG is set in the ConfigSettings.cmake 29 # file of the BASIS installation. Note that this statement will set the 30 # variable ${NS}INCLUDE_DIR, where by default @c NS is the package name 31 # followed by an underscore (_). 33 # See the Config.cmake.in file of BASIS for details. 35 # @ingroup BasisConfig 36 ############################################################################## 38 ## @addtogroup BasisConfig 42 # ============================================================================ 44 # ============================================================================ 46 # prefix used for variable names 49 # allow caller to change
namespace - used by projects with modules
51 set (
NS "${${NS}CONFIG_PREFIX}_")
54 # ---------------------------------------------------------------------------- 56 set (${
NS}${NAME} ${ARGN})
59 # ---------------------------------------------------------------------------- 61 set (${
NS}${NAME} ${${
NS}${SRC}})
64 # ---------------------------------------------------------------------------- 66 list (APPEND ${
NS}${NAME} ${ARGN})
69 # ---------------------------------------------------------------------------- 71 list (FIND ${
NS}${NAME}
"${VALUE}" ${IDX})
74 # ---------------------------------------------------------------------------- 77 list (REMOVE_DUPLICATES ${
NS}${NAME})
81 # ---------------------------------------------------------------------------- 84 list (REMOVE_ITEM ${
NS}${NAME}
"${ITEM}")
88 # ---------------------------------------------------------------------------- 90 macro (basis_is_cached VAR ENTRY)
92 get_property (${VAR} CACHE ${ENTRY} PROPERTY TYPE SET)
99 # ---------------------------------------------------------------------------- 101 macro (basis_set_or_update_value VAR)
104 if (${ARGC} GREATER 1)
105 set_property (CACHE ${VAR} PROPERTY
VALUE ${ARGN})
107 set (${VAR}
"" CACHE INTERNAL
"" FORCE)
116 # ============================================================================ 118 # ============================================================================ 120 ## @brief Installation prefix or root of build tree. 124 ## @brief Project use file to be included by other projects.
125 basis_set_config (
USE_FILE "${CMAKE_CURRENT_LIST_DIR}/BASISUse.cmake")
127 ## @brief Directory of example files. 128 basis_set_config (EXAMPLE_DIR
"/Users/as12312/Software/BASIS/Workspace/example")
130 # ============================================================================ 132 # ============================================================================ 134 ## @brief Directory of header files. 135 basis_set_config (INCLUDE_DIR
"/Users/as12312/Software/BASIS/Xcode/include;/Users/as12312/Software/BASIS/Workspace/include")
137 ## @brief Directory of header files including dependencies. 138 basis_set_config (INCLUDE_DIRS)
# to have a set recognized by Doxygen filter 142 ## @brief Directory of libraries. 145 ## @brief Directory of libraries including dependencies. 146 basis_set_config (LIBRARY_DIRS)
# to have a set() recognized by Doxygen filter 150 ## @brief Search path for Python modules. 151 basis_set_config (PYTHONPATH
"/Users/as12312/Software/BASIS/Xcode/lib/python")
153 ## @brief Search path for Jython modules. 154 basis_set_config (JYTHONPATH
"/Users/as12312/Software/BASIS/Xcode/lib/jython")
156 ## @brief Search path for Perl modules. 159 ## @brief Search path for MATLAB modules. 160 basis_set_config (MATLABPATH
"/Users/as12312/Software/BASIS/Xcode/lib/matlab")
162 ## @brief Search path for Bash modules. 164 # See the import() function of the BASIS Bash utilities. 167 # ============================================================================ 169 # ============================================================================ 171 ## @brief Absolute path of exports file to be included by other projects. 174 ## @brief Absolute path of custom exports file to be included by other projects. 177 # ============================================================================ 179 # ============================================================================ 181 ## @brief Directory containing module configuration files 182 basis_set_config (MODULES_DIR
"/Users/as12312/Software/BASIS/Xcode/lib/cmake/basis")
184 ## @brief List of known project modules. 187 ## @brief List of found requested modules. 190 ## @brief List of not found optional modules. 193 ## @brief List of available project modules. 195 file (GLOB _CONFIG_FILES "${${
NS}MODULES_DIR}/BASIS*Config.cmake
") 196 foreach (_CONFIG_FILE IN LISTS _CONFIG_FILES) 197 if (_CONFIG_FILE MATCHES "/BASIS([^ /][^ /]*)Config.cmake
") 198 set (_MODULE_NAME ${CMAKE_MATCH_1}) 199 basis_append_config (MODULES ${_MODULE_NAME}) 200 basis_append_config (MODULES_ENABLED ${_MODULE_NAME}) 204 basis_remove_duplicates_config (MODULES) 205 basis_remove_duplicates_config (MODULES_ENABLED) 207 unset (_CONFIG_FILES) 210 ## @brief List of modules requested by external package using the 211 # @c COMPONENTS argument of 213 # find_package()</a>. 214 if (NOT DEFINED ${
NS}MODULES_REQUESTED)
215 if (${
NS}FIND_COMPONENTS)
218 if (NOT ${
NS}MODULES_REQUESTED)
225 foreach (_MODULE_NAME IN LISTS ${NS}MODULES_REQUESTED) 226 # check if requested module is available 227 basis_find_config (MODULES_ENABLED ${_MODULE_NAME} _MODULE_IDX) 228 if (_MODULE_IDX EQUAL -1) 229 # set <Pkg>_<Module>_FOUND = FALSE 230 basis_set_config (${_MODULE_NAME}_FOUND FALSE) 231 # append to list of not found requested modules 232 basis_append_config (MODULES_NOTFOUND ${_MODULE_NAME}) 235 # include configuration file of module 236 set (${_MODULE_NAME}_CONFIG_PREFIX "${
_MODULE_NS}
") 238 unset (${_MODULE_NAME}_CONFIG_PREFIX) 239 set (NS "${
_PACKAGE_NS}
") # restore NS of this package config 240 # append include directories 241 if (${_MODULE_NS}INCLUDE_DIRS) 242 basis_append_config (INCLUDE_DIRS ${${_MODULE_NS}INCLUDE_DIRS}) 243 elseif (${_MODULE_NS}INCLUDE_DIR) 244 basis_append_config (INCLUDE_DIRS ${${_MODULE_NS}INCLUDE_DIR}) 246 # append library directories 247 if (${_MODULE_NS}LIBRARY_DIRS) 248 basis_append_config (LIBRARY_DIRS ${${_MODULE_NS}LIBRARY_DIRS}) 249 elseif (${_MODULE_NS}LIBARY_DIR) 250 basis_append_config (LIBRARY_DIRS ${${_MODULE_NS}LIBRARY_DIR}) 252 # set <Pkg>_<Module>_FOUND = TRUE 253 basis_set_config (${_MODULE_NAME}_FOUND TRUE) 254 # append to list of found requested modules 255 basis_append_config (MODULES_FOUND ${_MODULE_NAME}) 260 if (${NS}MODULES_NOTFOUND) 264 foreach (_MODULE_NAME IN LISTS ${NS}MODULES_REQUESTED) 265 if (${NS}FIND_REQUIRED_${_MODULE_NAME}) 266 list (APPEND _REQUIRED ${_MODULE_NAME}) 267 if (NOT ${NS}${_MODULE_NAME}_FOUND) 268 list (APPEND _MISSING ${_MODULE_NAME}) 271 list (APPEND _OPTIONAL ${_MODULE_NAME}) 275 message(FATAL_ERROR "Could not find all required BASIS components!
" 276 " Rebuild and/or install the BASIS
package with"
277 " the following modules enabled by setting MODULE_<name>"
278 " to ON when configuring the build of the package with CMake."
279 "\nOptional modules = [${_OPTIONAL}]"
280 "\nRequired modules = [${_REQUIRED}]"
281 "\nMissing modules = [${_MISSING}]\n")
292 # ============================================================================
293 # clean INCLUDE_DIRS and LIBRARY_DIRS
294 # ============================================================================
296 basis_remove_duplicates_config (INCLUDE_DIR)
297 basis_remove_duplicates_config (INCLUDE_DIRS)
298 basis_remove_duplicates_config (LIBRARY_DIR)
299 basis_remove_duplicates_config (LIBRARY_DIRS)
301 basis_remove_item_config (INCLUDE_DIRS "")
302 basis_remove_item_config (LIBRARY_DIRS "")
304 # ============================================================================
306 # ============================================================================
308 set (_depwarn " set to different value than during the configuration of BASIS."
309 " Using different versions of a dependency may cause inconsistencies!")
311 if (DEPENDS_Python_DIR)
312 if (NOT DEPENDS_Python_DIR STREQUAL "/usr/bin")
313 message (WARNING DEPENDS_Python_DIR ${_depwarn})
316 basis_set_or_update_value (DEPENDS_Python_DIR "/usr/bin")
319 if (DEPENDS_Jython_DIR)
320 if (NOT DEPENDS_Jython_DIR STREQUAL "/usr/local/bin")
321 message (WARNING DEPENDS_Jython_DIR ${_depwarn})
324 basis_set_or_update_value (DEPENDS_Jython_DIR "/usr/local/bin")
327 if (DEPENDS_Perl_DIR)
328 if (NOT DEPENDS_Perl_DIR STREQUAL "/usr/bin")
329 message (WARNING DEPENDS_Perl_DIR ${_depwarn})
332 basis_set_or_update_value (DEPENDS_Perl_DIR "/usr/bin")
335 if (DEPENDS_MATLAB_DIR)
336 if (NOT DEPENDS_MATLAB_DIR STREQUAL "/Applications/MATLAB_R2016a.app")
337 message (WARNING DEPENDS_MATLAB_DIR ${_depwarn})
340 basis_set_or_update_value (DEPENDS_MATLAB_DIR "/Applications/MATLAB_R2016a.app")
343 if (DEPENDS_BASH_DIR)
344 if (NOT DEPENDS_BASH_DIR STREQUAL "/bin")
345 message (WARNING DEPENDS_BASH_DIR ${_depwarn})
348 basis_set_or_update_value (DEPENDS_BASH_DIR "/bin")
352 # ============================================================================
353 # BASIS configuration
354 # ============================================================================
356 # ----------------------------------------------------------------------------
359 ## @brief Absolute path to CMake modules.
360 basis_set_config (MODULE_PATH "/Users/as12312/Software/BASIS/Workspace/src/cmake/modules")
362 ## @brief Absolute path to CMake Find modules.
363 basis_set_config (FIND_MODULE_PATH "/Users/as12312/Software/BASIS/Workspace/src/cmake/find")
365 # ----------------------------------------------------------------------------
368 ## @brief List of enabled BASIS utilities.
369 basis_set_config (UTILITIES_ENABLED "CXX;PYTHON;PERL;BASH
") 371 ## @brief Python interpreter used to build/configure BASIS Python modules. 372 basis_set_config (PYTHON_EXECUTABLE "/usr/bin/python
") 373 ## @brief Jython interpreter used to build/configure BASIS Jython modules. 374 basis_set_config (JYTHON_EXECUTABLE "/usr/local/bin/jython
") 375 ## @brief Perl interpreter used to build/configure BASIS Perl modules. 376 basis_set_config (PERL_EXECUTABLE "/usr/bin/perl
") 377 ## @brief Bash executable used to build/configure BASIS Bash modules. 378 basis_set_config (BASH_EXECUTABLE "/bin/bash
") 380 ## @brief Absolute path to C++ utilities files. 381 basis_set_config (CXX_TEMPLATES_DIR "/Users/as12312/Software/BASIS/Workspace/src/utilities/cxx
") 382 ## @brief Absolute path to Python utilities files. 383 basis_set_config (PYTHON_TEMPLATES_DIR "/Users/as12312/Software/BASIS/Workspace/src/utilities/python
") 384 ## @brief Absolute path to Python utilities files. 385 basis_set_config (JYTHON_TEMPLATES_DIR "/Users/as12312/Software/BASIS/Workspace/src/utilities/jython
") 386 ## @brief Absolute path to Perl utilities files. 387 basis_set_config (PERL_TEMPLATES_DIR "/Users/as12312/Software/BASIS/Workspace/src/utilities/perl
") 388 ## @brief Absolute path to MATLAB utilities files. 389 basis_set_config (MATLAB_TEMPLATES_DIR "/Users/as12312/Software/BASIS/Workspace/src/utilities/matlab
") 390 ## @brief Absolute path to Bash utilities files. 391 basis_set_config (BASH_TEMPLATES_DIR "/Users/as12312/Software/BASIS/Workspace/src/utilities/bash
") 393 ## @brief C++ utilities library. 394 basis_set_config (CXX_UTILITIES_LIBRARY "basis.utilities_cxx
") 395 ## @brief Python utilities library. 396 basis_set_config (PYTHON_UTILITIES_LIBRARY "basis.utilities_python
") 397 ## @brief Jython utilities library. 398 basis_set_config (JYTHON_UTILITIES_LIBRARY "basis.
") 399 ## @brief Perl utilities library. 400 basis_set_config (PERL_UTILITIES_LIBRARY "basis.utilities_perl
") 401 ## @brief MATLAB utilities library. 402 basis_set_config (MATLAB_UTILITIES_LIBRARY "basis.
") 403 ## @brief Bash utilities library. 404 basis_set_config (BASH_UTILITIES_LIBRARY "basis.utilities_bash
") 406 ## @brief Unit testing library. 407 basis_set_config (TEST_LIBRARY "basis.testlib
") 408 ## @brief Implementation of main() function of unit test driver. 409 basis_set_config (TEST_MAIN_LIBRARY "basis.testmain
") 411 ## @brief Main libraries. 412 basis_set_config (LIBRARIES 413 ${${NS}UTILITIES_LIBRARY} 417 # ---------------------------------------------------------------------------- 420 ## @brief Path of Sphinx extensions. 421 basis_set_config (SPHINX_EXTENSIONS_PATH "/Users/as12312/Software/BASIS/Xcode/lib/python/
basis/sphinx/ext
") 422 ## @brief Path of Sphinx HTML themes. 423 basis_set_config (SPHINX_HTML_THEME_PATH "/Users/as12312/Software/BASIS/Workspace/src/sphinx/themes
") 425 # ---------------------------------------------------------------------------- 428 include ("${${
NS}MODULE_PATH}/BasisSettings.cmake
" NO_POLICY_SCOPE) 429 include ("${${
NS}MODULE_PATH}/BasisTools.cmake
") 433 # end of Doxygen group - keep at end of file macro basis_append_config(in NAME)
cmake LIBRARY_DIR
Directory of shared and module libraries relative to script location.
cmake EXPORTS_FILE
Name of the CMake target exports file.
macro basis_set_or_update_value(in VAR)
cmake USE_FILE
Name of the CMake package use file.
macro basis_find_config(in NAME, in VALUE, in IDX)
cmake CONFIG_PREFIX
Package name.
cmake _PACKAGE_NS
List of modules requested by external package using the COMPONENTS argument of find_package().
macro basis_remove_item_config(in NAME, in ITEM)
cmake CUSTOM_EXPORTS_FILE
Name of the CMake target exports file for custom targets.
macro basis_is_cached(in VAR, in ENTRY)
macro basis_remove_duplicates_config(in NAME)
macro basis_copy_config(in NAME, in SRC)
macro basis_set_config(in NAME)
function get_filename_component(inout ARGN)
Fixes CMake's get_filename_component() command.