BASIS  version 1.2.3 (revision 2104)
Files | Functions | Variables
CMake Utilities
Auxiliary CMake Modules

Utilities implementated by the CMake modules. More...

+ Collaboration diagram for CMake Utilities:

Files

file  CheckPublicHeaders.cmake
 

CMake script used to check whether public headers were added/removed.


file  ConfigureIncludeFiles.cmake
 

CMake script used to configure and copy the public header files.


file  ExecuteProcess.cmake
 

Execute process using CMake script mode.


file  TopologicalSort.cmake
 

CMake implementation of topological sorting algorithm.


Functions

function add_executable (in TARGET, in ARGN)
 Add executable target.
function add_library (in TARGET, in ARGN)
 Add library target.
function basis_add_custom_finalize ()
 Finalize addition of custom targets.
function basis_add_executable_target (in TARGET_NAME, in ARGN)
 Adds an executable target built from C++ source code.
function basis_add_imported_target (in TARGET, in TYPE)
 Add imported target.
function basis_add_library_target (in TARGET_NAME, in ARGN)
 Add build target for library built from C++ source code.
function basis_add_mcc_target (in TARGET_NAME, in ARGN)
 Add MATLAB Compiler target.
function basis_add_mcc_target_finalize (in TARGET_UID)
 Finalize addition of MATLAB Compiler target.
function basis_add_mex_target (in TARGET_NAME, in ARGN)
 Add MEX target.
function basis_add_mex_target_finalize (in TARGET_UID)
 Finalize addition of MEX target.
function basis_add_script (in TARGET_NAME, in ARGN)
 Add script target.
function basis_add_script_finalize (in TARGET_UID)
 Finalize addition of script.
function basis_add_tests_of_default_options (in TARGET_NAME)
 Add tests of default options for given executable.
function basis_add_uninstall ()
 Add uninstall target.
macro basis_buildtree_asserts (in ARGN)
 Ensure certain requirements on build tree.
function basis_check_target_name (in TARGET_NAME)
 Checks whether a given name is a valid target name.
function basis_check_test_name (in TEST_NAME)
 Checks whether a given name is a valid test name.
function basis_configure_auxiliary_modules ()
 Configure auxiliary modules for scripting languages.
function basis_configure_auxiliary_sources (in SOURCES, in HEADERS, in PUBLIC_HEADERS)
 Configure auxiliary C++ source files.
function basis_configure_ExecutableTargetInfo ()
 Configure ExecutibleTargetInfo modules.
function basis_configure_public_headers ()
 Configure public header files.
macro basis_configure_root_documentation_files ()
 Configure root documentation files.
function basis_configure_sources (in LIST_NAME, in ARGN)
 Configure .in source files.
function basis_create_addpaths_mfile ()
 This function writes a MATLAB M-file with addpath() statements.
function basis_default_doxygen_filters (in FILTER_PATTERNS)
 Get default Doxygen filter patterns.
function basis_disable_testing_if_no_tests ()
 Disable testing if project does not implement any tests.
function basis_dump_variables (in RESULT_FILE)
 Output current CMake variables to file.
function basis_export_build_properties (in CODE)
 Add code to set properties of imported targets for build tree.
function basis_export_footer (in CODE)
 Add footer of exports file.
function basis_export_header (in CODE)
 Generate header of exports file.
function basis_export_import_targets (in CODE)
 Add code to add import targets.
function basis_export_install_properties (in CODE)
 Add code to set properties of imported targets for installation.
function basis_export_prefix (in CODE)
 Add code to compute prefix relative to INSTALL_CONFIG_DIR.
function basis_export_targets ()
 Export all targets added by basis_add_* commands.
macro basis_find_packages ()
 Find packages this project depends on.
function basis_get_build_timestamp (in TIMESTAMP)
 Get build time stamp.
function basis_get_full_matlab_version (in VERSION)
 Determine version of MATLAB installation.
function basis_get_fully_qualified_target_uid (in TARGET_UID, in TARGET_NAME)
 Get fully-qualified target name.
macro basis_get_fully_qualified_test_uid (in TEST_UID, in TEST_NAME)
 Get "global" test name, i.e., actual CTest test name.
function basis_get_matlab_release (in ARGN)
 Determine release version of MATLAB installation.
function basis_get_matlab_version (in ARGN)
 Determine version of MATLAB installation.
function basis_get_project_property (in VARIABLE, in ARGN)
 Get project-global property value.
function basis_get_soname (in SONAME, in OBJFILE)
 Get soname of object file.
function basis_get_source_language (in LANGUAGE, in ARGN)
 Detect programming language of given source code files.
function basis_get_source_target_name (in TARGET_NAME, in SOURCE_FILE, in COMPONENT)
 Derive target name from source file name.
function basis_get_target_location (in VAR, in TARGET_NAME, in PART)
 Get location of build target output file.
function basis_get_target_name (in TARGET_NAME, in TARGET_UID)
 Get "local" target name, i.e., BASIS target name.
function basis_get_target_namespace (in TARGET_NS, in TARGET_UID)
 Get namespace of build target.
function basis_get_target_type (in TYPE, in TARGET_NAME)
 Get type name of target.
function basis_get_target_uid (in TARGET_UID, in TARGET_NAME)
 Get "global" target name, i.e., actual CMake target name.
macro basis_get_test_name (in TEST_NAME, in TEST_UID)
 Get "local" test name, i.e., BASIS test name.
macro basis_get_test_namespace (in TEST_NS, in TEST_UID)
 Get namespace of test.
macro basis_get_test_uid (in TEST_UID, in TEST_NAME)
 Get "global" test name, i.e., actual CTest test name.
macro basis_initialize_settings ()
 Initialize project settings.
function basis_install_links ()
 Adds installation rules to create default symbolic links.
macro basis_installtree_asserts (in ARGN)
 Ensure certain requirements on install tree.
function basis_list_to_delimited_string (in STR, in DELIM, in ARGN)
 Concatenates all list elements into a single delimited string.
macro basis_list_to_regex (in REGEX, in ARGN)
 Convert list into regular expression.
function basis_list_to_string (in STR, in ARGN)
 Concatenates all list elements into a single string.
macro basis_make_target_uid (in TARGET_UID, in TARGET_NAME)
 Make target UID from given target name.
macro basis_make_test_uid (in TEST_UID, in TEST_NAME)
 Make test UID from given test name.
function basis_mexext (in ARGN)
 Determine extension of MEX-files for this architecture.
function basis_normalize_name (in OUT, in STR)
 Convert string to lowercase only or mixed case.
function basis_process_generator_expressions (in ARGS, in ARGN)
 Process generator expressions in arguments.
macro basis_project_finalize ()
 Finalize build configuration of project.
macro basis_project_initialize ()
 Initialize project, calls CMake's project() command.
macro basis_project_modules ()
 Initialize project modules.
macro basis_sanitize_for_regex (in OUT, in STR)
 Sanitize string variable for use in regular expression.
macro basis_set_if_empty (in VAR, in ARGN)
 Set value of variable only if variable is not set already.
macro basis_set_if_not_set (in VAR, in ARGN)
 Set value of variable only if variable is not defined yet.
function basis_set_or_update_cache (in VAR)
 Set variable.
function basis_set_project_property ()
 Set project-global property.
function basis_string_to_list (in LST, in STR)
 Splits a string at space characters into a list.
function basis_svn_get_last_changed_revision (in URL, in REV)
 Get revision number when directory or file was last changed.
function basis_svn_get_revision (in URL, in REV)
 Get current revision of file or directory.
function basis_svn_status (in URL, in STATUS)
 Get status of revision controlled file.
function basis_update_cache (in VAR)
 Update cache variable.
function basis_update_imported_location (in TARGET, in PROPERTY, in LOCATION)
 Update location of imported target.
function basis_update_imported_type (in TARGET, in TYPE)
 Update type of imported target.
function basis_use_auxiliary_sources (in SOURCES_LIST, in HEADERS_LIST)
 Add include directories of auxiliary sources to search path.
function basis_version_numbers (in VERSION, in MAJOR, in MINOR, in PATCH)
 Extract version numbers from version string.
function get_filename_component (in ARGN)
 Fixes CMake's get_filename_component() command.
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.
function set_target_properties (in ARGN)
 Set target property.

Variables

 BASIS_DOXYGEN_DOXYFILE
 Default Doxygen configuration.
 CONFIG_FILE
 Name of the CMake package configuration file.
 CONFIG_PREFIX
 Package name.
 CUSTOM_EXPORTS_FILE
 Name of the CMake target exports file for custom targets.
 EXPORTS_FILE
 Name of the CMake target exports file.
 USE_FILE
 Name of the CMake package use file.
 VERSION_FILE
 Name of the CMake package version file.

Detailed Description

Utilities implementated by the CMake modules.


Function Documentation

function add_executable ( in  TARGET,
in  ARGN 
)

Add executable target.

This BASIS function overwrites CMake's add_executable() command in order to store information of imported targets which is in particular used to generate the source code of the ExecutableTargetInfo modules which are part of the BASIS utilities.

Note:
Use basis_add_executable() instead where possible!
Parameters:
[in]TARGETName of the target.
[in]ARGNFurther arguments of CMake's add_executable().
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_executable
function add_library ( in  TARGET,
in  ARGN 
)

Add library target.

This BASIS function overwrites CMake's add_library() command in order to store information of imported targets.

Note:
Use basis_add_library() instead where possible!
Parameters:
[in]TARGETName of the target.
[in]ARGNFurther arguments of CMake's add_library().
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_library
function basis_add_custom_finalize ( )

Finalize addition of custom targets.

This function is called by basis_add_project_finalize() to finalize the addition of the custom build targets such as, for example, build targets to build script files, MATLAB Compiler targets, and MEX script generated MEX-files.

Returns:
Adds custom targets that actually build the executables and libraries for which custom build targets where added by basis_add_executable(), basis_add_library(), and basis_add_script().
See also:
basis_add_script_finalize()
basis_add_mcc_target_finalize()
basis_add_mex_target_finalize()
function basis_add_executable_target ( in  TARGET_NAME,
in  ARGN 
)

Adds an executable target built from C++ source code.

This function adds an executable target for the build of an executable from C++ source code files. Refer to the documentation of basis_add_executable() for a description of general options for adding an executable target.

By default, the BASIS C++ utilities library is added as link dependency of the executable target. If none of the BASIS C++ utilities are used by the executable, the option NO_BASIS_UTILITIES can be given. To enable this option by default, set the variable BASIS_NO_BASIS_UTILITIES to TRUE before the basis_add_executable() commands, i.e., best in the Settings.cmake file located in the PROJECT_CONFIG_DIR. Note, however, that the utilities library is a static library and thus the linker would simply not include any of the BASIS utilities object code in the final binary executable file if not used.

Note:
This function should not be used directly. Instead, it is called by basis_add_executable() if the (detected) programming language of the given source code files is CXX (i.e., C/C++).
Parameters:
[in]TARGET_NAMEName of the target. If a source file is given as first argument, the build target name is derived from the name of this source file.
[in]ARGNThis argument list is parsed and the following arguments are extracted, all other arguments are considered to be source code files and simply passed on to CMake's add_executable() command.
DESTINATION dir Installation directory relative to INSTALL_PREFIX. If "none" (the case is ignored) is given as argument, no installation rules are added for this executable target. Default: INSTALL_RUNTIME_DIR or INSTALL_LIBEXEC_DIR (if LIBEXEC is given).
COMPONENT name Name of the component. Default: BASIS_RUNTIME_COMPONENT.
LIBEXEC Specifies that the built executable is an auxiliary executable which is only called by other executable.
NO_BASIS_UTILITIES Do not add the BASIS C++ utilities as link dependency.
NO_EXPORT Do not export the target.
Returns:
Adds an executable build target built from C++ sources.
See also:
basis_add_executable()
basis_install()
function basis_add_imported_target ( in  TARGET,
in  TYPE 
)

Add imported target.

Imported targets are only valid in the scope where they were imported. In order to be able to add the information of the imported executable targets to the ExecutableTargetInfo modules of the BASIS utilities which are configured during the finalization of the (top-level) project, the information of imported targets has to be stored in the global scope. Therefore, internal cache variables prefixed by the name of the project are used (see basis_set_project_property()):

IMPORTED_TARGETS List of imported targets.
IMPORTED_TYPES Types of imported targets.
IMPORTED_LOCATIONS Locations of imported target files.
IMPORTED_RANKS Rank of current imported locations. This rank value is used to decide whether the current location takes precedence over another imported location. For example, IMPORTED_LOCATION_<a>, may be preferred over IMPORTED_LOCATION_<b>.
Parameters:
[in]TARGETName (UID) of the imported target.
[in]TYPEType of the imported target.
See also:
basis_update_imported_location()
function basis_add_library_target ( in  TARGET_NAME,
in  ARGN 
)

Add build target for library built from C++ source code.

This function adds a library target which builds a library from C++ source code files. Refer to the documentation of basis_add_library() for a description of the general options for adding a library target.

Note:
This function should not be used directly. Instead, it is called by basis_add_library() if the (detected) programming language of the given source code files is CXX (i.e., C/C++) and the option MEX is not given.
Parameters:
[in]TARGET_NAMEName of the target. If a source file is given as first argument, the build target name is derived from the name of this source file.
[in]ARGNThis argument list is parsed and the following arguments are extracted. All other arguments are considered to be source code files and simply passed on to CMake's add_library() command.
STATIC|SHARED|MODULE Type of the library.
DESTINATION dir Installation directory for runtime and library component relative to INSTALL_PREFIX. See RUNTIME_DESTINATION and LIBRARY_DESTINATION.
RUNTIME_DESTINATION dir Installation directory of the runtime component relative to INSTALL_PREFIX. If "none" (case ignored) is given as argument, no installation rule for the runtime library is not added. Default: INSTALL_LIBRARY_DIR on Unix or INSTALL_RUNTIME_DIR on Windows.
LIBRARY_DESTINATION dir Installation directory of the library component relative to INSTALL_PREFIX. If "none" (case ignored) is given as argument, no installation rule for the library component is added. Default: INSTALL_ARCHIVE_DIR.
COMPONENT name Name of the component. Default: BASIS_LIBRARY_COMPONENT.
RUNTIME_COMPONENT name Name of runtime component. Default: COMPONENT if specified or BASIS_RUNTIME_COMPONENT, otherwise.
LIBRARY_COMPONENT name Name of library component. Default: COMPONENT if specified or BASIS_LIBRARY_COMPONENT, otherwise.
NO_EXPORT Do not export build target.
Returns:
Adds a library build target.
function basis_add_mcc_target ( in  TARGET_NAME,
in  ARGN 
)

Add MATLAB Compiler target.

This function is used to add an executable or library target which is built using the MATLAB Compiler (MCC). It is invoked by basis_add_executable() or basis_add_library(), respectively, when at least one M-file is given as source file. Thus, it is recommended to use these functions instead.

An install command for the added executable or library target is added by this function as well. The executable will be installed as part of the RUNTIME_COMPONENT in the directory INSTALL_RUNTIME_DIR. The runtime library will be installed as part of the RUNTIME_COMPONENT in the directory INSTALL_LIBRARY_DIR on UNIX systems and INSTALL_RUNTIME_DIR on Windows. Static/import libraries will be installed as part of the LIBRARY_COMPONENT in the directory INSTALL_ARCHIVE_DIR.

Note:
The custom build command is not added yet by this function. Only a custom target which stores all the information required to setup this build command is added. The custom command is added by either basis_project_finalize() or basis_superproject_finalize(). This way, the properties such as the OUTPUT_NAME of the custom target can be still modified.
If this function is used within the PROJECT_TESTING_DIR, the built executable is output to the BINARY_TESTING_DIR directory tree instead. Moreover, no installation rules are added. Test executables are further not exported, regardless of whether NO_EXPORT is given or not.
Parameters:
[in]TARGET_NAMEName of the target. If a source file is given as first argument, the build target name is derived from the name of this source file.
[in]ARGNRemaining arguments such as in particular the input source files. Moreover, the following arguments are parsed:
TYPE type Type of the target. Either EXECUTABLE (default) or LIBRARY.
COMPONENT name Name of the component. Default: BASIS_RUNTIME_COMPONENT if TYPE is EXECUTABLE or BASIS_LIBRARY_COMPONENT, otherwise.
RUNTIME_COMPONENT name Name of runtime component. Default: COMPONENT if specified or BASIS_RUNTIME_COMPONENT, otherwise.
LIBRARY_COMPONENT name Name of library component. Default: COMPONENT if specified or BASIS_LIBRARY_COMPONENT, otherwise.
LIBEXEC Specifies that the built executable is an auxiliary executable called by other executables only.
NO_EXPORT Do not export the target.
Returns:
Adds custom target which builds depending on the TYPE argument either an executable or a shared library using the MATLAB Compiler.
See also:
basis_add_executable()
basis_add_library()
function basis_add_mcc_target_finalize ( in  TARGET_UID)

Finalize addition of MATLAB Compiler target.

This function uses the properties of the custom MATLAB Compiler target added by basis_add_mcc_target() to create the custom build command and adds this build command as dependency of this added target.

Parameters:
[in]TARGET_UID"Global" target name. If this function is used within the same project as basis_add_mcc_target(), the "local" target name may be given alternatively.
Returns:
Adds custom target(s) which actually performs the invocation of the MATLAB Compiler using the values of the properties of the target with UID TARGET_UID.
See also:
basis_add_mcc_target()
function basis_add_mex_target ( in  TARGET_NAME,
in  ARGN 
)

Add MEX target.

This function is used to add a shared library target which is built using the MATLAB MEX script (mex). It is invoked by basis_add_library(). Thus, it is recommended to use this function instead.

An install command for the added library target is added by this function as well. The MEX-file will be installed as part of the COMPONENT in the directory INSTALL_LIBRARY_DIR on UNIX systems and INSTALL_RUNTIME_DIR on Windows.

Note:
The custom build command is not added yet by this function. Only a custom target which stores all the information required to setup this build command is added. The custom command is added by either basis_project_finalize() or basis_superproject_finalize(). This way, the properties such as the OUTPUT_NAME of the custom target can be still modified.
Parameters:
[in]TARGET_NAMEName of the target. If a source file is given as first argument, the build target name is derived from the name of this source file.
[in]ARGNRemaining arguments such as in particular the input source files. Moreover, the following arguments are parsed:
COMPONENT name Name of the component. Default: BASIS_LIBRARY_COMPONENT.
MFILE file MATLAB source file with function prototype and documentation of MEX-file.
NO_EXPORT Do not export the target.
Returns:
Adds custom target to build MEX-file using the MEX script.
See also:
basis_add_library()
function basis_add_mex_target_finalize ( in  TARGET_UID)

Finalize addition of MEX target.

This function uses the properties of the custom MEX-file target added by basis_add_mex_target() to create the custom build command and adds this build command as dependency of this added target.

Parameters:
[in]TARGET_UID"Global" target name. If this function is used within the same project as basis_add_mex_target(), the "local" target name may be given alternatively.
Returns:
Adds custom targets corresponding to the custom target added by basis_add_mex_target() which actually perform the invocation of the MEX script.
See also:
basis_add_mex_target()
function basis_add_script ( in  TARGET_NAME,
in  ARGN 
)

Add script target.

If the script name ends in ".in", the ".in" suffix is removed from the output name. Further, the extension of the script such as .sh or .py is removed from the output filename of executable scripts. On Unix, a shebang directive is added to executable scripts at the top of the script files instead if such directive is not given yet. In order to enable the convenient execution of Python and Perl scripts on Windows as well, some Batch code is added at the top and bottom of executable Python and Perl scripts which calls the Python or Perl interpreter with the script file and the given script arguments as command-line arguments. The file name extension of such modified scripts is by default set to .cmd, the common extension for Windows NT Command Scripts. Scripts in other languages are not specifically modified. In case of script modules, the script file name extension is preserved in any case. When the WITH_EXT option is given, executable scripts are not modified as described and their file name extension is preserved.

Example:

 basis_add_script (MyShellScript.sh.in)
 basis_add_script (Script Script1.sh)

Certain CMake variables within the script are replaced during the configure step. See Prerequisits and Build Steps for details.

Note that this function only configures the script file if it ends in the ".in" suffix and adds a custom target which stores all information required to setup the actual custom build command as properties. The custom build command itself is added by basis_add_script_finalize(), which is supposed to be called once at the end of the root CMakeLists.txt file. This way properties such as the OUTPUT_NAME can still be modified after adding the script target.

Note:
If this function is used within the PROJECT_TESTING_DIR, the built executable is output to the BINARY_TESTING_DIR directory tree instead. Moreover, no installation rules are added. Test executables are further not exported, regardless of whether NO_EXPORT is given or not.
This function should not be used directly. Instead, the functions basis_add_executable() and basis_add_library() should be used which in turn make use of this function if the (detected) programming language is a (supported) scripting language.
Parameters:
[in]TARGET_NAMEName of the target. If the target is build from a single source file, the file path of this source file can be given as first argument. The build target name is then derived from the name of the source file.
[in]ARGNThis argument list is parsed and the following arguments are extracted:
COMPONENT name Name of the component. Default: BASIS_RUNTIME_COMPONENT for executable scripts or BASIS_LIBRARY_COMPONENT for modules.
CONFIG config Additional script configuration given directly as string argument. This string is included in the CMake build script before configuring the script file after the script configuration files have been included.
CONFIG_FILE file Additional script configuration file. This file is included after the default script configuration file of BASIS and after the default script configuration file which is located in PROJECT_BINARY_DIR, but before the script configuration code given by CONFIG.
DESTINATION dir The installation directory relative to INSTALL_PREFIX. Default: INSTALL_RUNTIME_DIR or INSTALL_LIBEXEC_DIR if the LIBEXEC option is given or INSTALL_LIBRARY_DIR if the MODULE option is given.
LIBEXEC Specifies that the built executable is an auxiliary executable which is only called by other executable.
MODULE

Specifies that the script is a module file which is included by other scripts. Implies LIBEXEC regarding installation directory and preserves file name extension on all platforms. It can be used, for example, for Python modules that are to be imported only by other Python scripts.

Note that this option can also be used for arbitrary text files which are used as input to a program, not only actual modules written in a scripting language.

WITH_PATH Preserve relative path of module. Required for example for Python and Perl packages where the directory hierarchy is important.
WITH_EXT Specify that the existing filename extension should be kept also in case of an executable script. No shebang directive is added to the top of the script automatically if this option is given. On Windows, on the other side, this prevents the addition of Batch code to execute the script and no .cmd file name extension is used for executable scripts build with this option.
NO_EXPORT Do not export build target.
COMPILE | NOCOMPILE Enable/disable compilation of script if supported by scripting language as well as BASIS. In particular, Python modules can be compiled. If a script could be compiled by BASIS, only the compiled file is installed. Default: BASIS_COMPILE_SCRIPTS
Returns:
Adds custom build target TARGET_NAME. In order to add the custom target that actually builds the script file, basis_add_script_finalize() has to be invoked.
See also:
basis_add_executable()
basis_add_library()
basis_add_script_finalize()
basis_add_custom_finalize()
function basis_add_script_finalize ( in  TARGET_UID)

Finalize addition of script.

This function uses the properties of the custom script target added by basis_add_script() to create the custom build command and adds this build command as dependency of this added target.

Parameters:
[in]TARGET_UID"Global" target name. If this function is used within the same project as basis_add_script(), the "local" target name may be given alternatively.
Returns:
Adds custom target(s) to actually build the script target TARGET_UID added by basis_add_script().
See also:
basis_add_script()
basis_add_custom_finalize()
function basis_add_tests_of_default_options ( in  TARGET_NAME)

Add tests of default options for given executable.

Default options:
--helpshort Short help. The output has to match the regular expression "[Uu]sage:\n\s*\<executable name\>", where <executable name> is the name of the tested executable.
--help, -h Help screen. Simply tests if the option is accepted.
--version Version information. Output has to include the project version string.
--verbose, -v Increase verbosity of output messages. Simply tests if the option is accepted.
Parameters:
[in]TARGET_NAMEName of executable or script target.
Returns:
Adds tests for the default options of the specified executable.
function basis_add_uninstall ( )

Add uninstall target.

Returns:
Adds the custom target uninstall and code to cmake_install.cmake to install an uninstaller.
macro basis_buildtree_asserts ( in  ARGN)

Ensure certain requirements on build tree.

Requirements:

  • Root of build tree must not be root of source tree.
Parameters:
[in]ARGNNot used.
Returns:
Nothing.
function basis_check_target_name ( in  TARGET_NAME)

Checks whether a given name is a valid target name.

Displays fatal error message when target name is invalid.

Parameters:
[in]TARGET_NAMEDesired target name.
Returns:
Nothing.
function basis_check_test_name ( in  TEST_NAME)

Checks whether a given name is a valid test name.

Displays fatal error message when test name is invalid.

Parameters:
[in]TEST_NAMEDesired test name.
Returns:
Nothing.
function basis_configure_auxiliary_sources ( in  SOURCES,
in  HEADERS,
in  PUBLIC_HEADERS 
)

Configure auxiliary C++ source files.

This function configures the following default auxiliary source files which can be used by the projects which are making use of BASIS.

basis.h Main include file which includes all the header files of the BASIS utilities including both, non-project specific utilities which are installed as part of BASIS, and project specific utilities configured by this function.
config.h This file is intended to be included by all source files. Hence, other projects will indirectly include this file when they use a library of this project. Therefore, it is important to avoid potential name conflicts.
config.cxx Definition of constants declared in config.h file. In particular, the paths of the installation directories relative to the executables are defined by this file. These constants are used by the auxiliary functions implemented in stdaux.h.
stdaux.h Declares auxiliary functions such as functions to get absolute path to the subdirectories of the installation.
stdaux.cxx Definition of auxiliary functions declared in stdaux.h.
ExecutableTargetInfo.h Declares ExecutableTargetInfo class which can be used at runtime to obtain information about an executable using the name of the corresponding BASIS/CMake build target.
ExecutableTargetInfo.cxx Definition of ExecutableTargetInfo class. The constructor of this singleton class is created during the configuration step of CMake by the function basis_configure_ExecutableTargetInfo().
Note:
If there exists a *.in file of the corresponding source file in the PROJECT_CONFIG_DIR, it will be used as template. Otherwise, the template file of BASIS is used.
Parameters:
[out]SOURCESConfigured auxiliary source files.
[out]HEADERSConfigured auxiliary header files.
[out]PUBLIC_HEADERSAuxiliary headers that should be installed.
Returns:
Sets the variables specified by the [out] parameters.
function basis_configure_ExecutableTargetInfo ( )

Configure ExecutibleTargetInfo modules.

This function generates the initialization code of the ExecutableTargetInfo module for different supported programming languages. In case of C++, the source file has been configured and copied to the binary tree in a first configuration pass such that it could be used in basis_add_*() commands which check the existence of the arguments immediately. As the generation of the initialization code requires a complete list of build targets (cached in BASIS_TARGETS), this function has to be called after all targets have been added and finalized (in case of custom targets).

Returns:
Nothing.
function basis_configure_public_headers ( )

Configure public header files.

Configure public header files whose file name ends with the .in. Moreover, if BASIS_COPY_INCLUDES_TO_BINARY_DIR is TRUE, this function copies all other files to the build tree as well, using the same relative paths as will be used for the installation.

See also:
BASIS_CONFIGURE_INCLUDES
macro basis_configure_root_documentation_files ( )

Configure root documentation files.

The root documentation files are located in the top-level directory of the project's source tree. These are, in particular, the AUTHORS.txt file with information on the authors of the software, COPYING.txt file with copyright and licensing information, README.txt file, INSTALL.txt file with build and installation instructions, WELCOME.txt file with text used as welcome text of the installer. where the top-level project requires all of these files except of the WELCOME.txt file which defaults to the readme file. Modules of a project usually do not include any of these files. Otherwise, the content of the module's documentation file is appended to the corresponding file of the top-level project.

function basis_configure_sources ( in  LIST_NAME,
in  ARGN 
)

Configure .in source files.

This function configures each source file in the given argument list with a .in file name suffix and stores the configured file in the build tree with the same relative directory as the template source file itself. The first argument names the CMake variable of the list of configured source files where each list item is the absolute file path of the corresponding (configured) source file.

Parameters:
[out]LIST_NAMEName of output list.
[in]ARGNThese arguments are parsed and the following options recognized. All remaining arguments are considered to be source file paths.
BINARY_DIRECTORY Explicitly specify directory in build tree where configured source files should be written to.
KEEP_DOT_IN_SUFFIX By default, after a source file with the .in extension has been configured, the .in suffix is removed from the file name. This can be omitted by giving this option.
Returns:
Nothing.
function basis_create_addpaths_mfile ( )

This function writes a MATLAB M-file with addpath() statements.

This function writes an MATLAB M-file into the top directory of the build tree which contains an addpath() statement for each directory that was added via basis_include_directories().

Returns:
Creates file add_<project>_paths.m in the current binary directory.
function basis_default_doxygen_filters ( in  FILTER_PATTERNS)

Get default Doxygen filter patterns.

Parameters:
[out]FILTER_PATTERNSList of default Doxygen filter patterns.
function basis_disable_testing_if_no_tests ( )

Disable testing if project does not implement any tests.

This function checks if there are test/ subdirectories in the project and disables and hides the BUILD_TESTING option if none are found.

function basis_get_build_timestamp ( in  TIMESTAMP)

Get build time stamp.

The build time stamp is used as an alternative to the version and revision information in PROJECT_VERSION_AND_REVISION if version is invalid, i.e., set to 0.0.0 as is the case for development branches, and now revision from a revision control system is available.

function basis_get_full_matlab_version ( in  VERSION)

Determine version of MATLAB installation.

Parameters:
[out]VERSIONValue returned by the "version" command of MATLAB or an empty string if execution of MATLAB failed.
Returns:
Sets the variable named by VERSION to the full MATLAB version.
function basis_get_fully_qualified_target_uid ( in  TARGET_UID,
in  TARGET_NAME 
)

Get fully-qualified target name.

This function always returns a fully-qualified target UID, no matter if the option BASIS_USE_FULLY_QUALIFIED_UIDS is OFF. Note that if this option is ON, the returned target UID is may not be the actual name of a CMake target.

Parameters:
[out]TARGET_UIDFully-qualified target UID.
[in]TARGET_NAMETarget name used as argument to BASIS CMake functions.
See also:
basis_get_target_uid()
macro basis_get_fully_qualified_test_uid ( in  TEST_UID,
in  TEST_NAME 
)

Get "global" test name, i.e., actual CTest test name.

This function always returns a fully-qualified test UID, no matter if the option BASIS_USE_FULLY_QUALIFIED_UIDS is OFF. Note that if this option is ON, the returned test UID may not be the actual name of a CMake test.

Parameters:
[out]TEST_UIDFully-qualified test UID.
[in]TEST_NAMETest name used as argument to BASIS CMake functions.
See also:
basis_get_test_uid()
function basis_get_matlab_release ( in  ARGN)

Determine release version of MATLAB installation.

Parameters:
[out]ARGNThe first argument ARGV0 is set to the release version of the MATLAB installation, i.e., "R2009b", for example, or an empty string if execution of MATLAB failed. If no output variable name is specified, the variable MATLAB_RELEASE is added to the cache if not present yet. Note that if no output variable is given and MATLAB_RELEASE is already set, nothing is done.
Returns:
Sets the variable named by the first argument to the release version of MATLAB.
function basis_get_matlab_version ( in  ARGN)

Determine version of MATLAB installation.

Parameters:
[out]ARGNThe first argument ARGV0 is set to the version of the MATLAB installation, i.e., "7.9.0", for example, or an empty string if execution of MATLAB failed. If no output variable name is specified, the variable MATLAB_VERSION is added to the cache if not present yet. Note that if no output variable is given and MATLAB_VERSION is already set, nothing is done.
Returns:
Sets the variable named by the first argument to the determined MATLAB version.
function basis_get_project_property ( in  VARIABLE,
in  ARGN 
)

Get project-global property value.

Example:

 basis_get_project_property(TARGETS)
 basis_get_project_property(TARGETS ${PROJECT_NAME})
 basis_get_project_property(TARGETS ${PROJECT_NAME} TARGETS)
 basis_get_project_property(TARGETS PROPERTY TARGETS)
Parameters:
[out]VARIABLEName of result variable.
[in]ARGNSee the example uses. The optional second argument is either the name of the project similar to CMake's get_target_property() command or the keyword PROPERTY followed by the name of the property.
function basis_get_soname ( in  SONAME,
in  OBJFILE 
)

Get soname of object file.

This function extracts the soname from object files in the ELF format on systems where the objdump command is available. On all other systems, an empty string is returned.

Parameters:
[out]SONAMEThe soname of the object file.
[in]OBJFILEObject file in ELF format.
function basis_get_source_language ( in  LANGUAGE,
in  ARGN 
)

Detect programming language of given source code files.

This function determines the programming language in which the given source code files are written. If no common programming language could be determined, "AMBIGUOUS" is returned. If none of the following programming languages could be determined, "UNKNOWN" is returned: CXX (i.e., C++), JAVA, JAVASCRIPT, PYTHON, PERL, BASH, BATCH, MATLAB.

Parameters:
[out]LANGUAGEDetected programming language.
[in]ARGNList of source code files.
function basis_get_source_target_name ( in  TARGET_NAME,
in  SOURCE_FILE,
in  COMPONENT 
)

Derive target name from source file name.

Parameters:
[out]TARGET_NAMETarget name.
[in]SOURCE_FILESource file.
[in]COMPONENTThird argument to get_filename_component().
Returns:
Target name derived from SOURCE_FILE.
function basis_get_target_location ( in  VAR,
in  TARGET_NAME,
in  PART 
)

Get location of build target output file.

This convenience function can be used to get the full path of the output file generated by a given build target. It is similar to the read-only LOCATION property of CMake targets and should be used instead of reading this porperty.

Parameters:
[out]VARPath of build target output file.
[in]TARGET_NAMEName of build target.
[in]PARTWhich file name component of the LOCATION property to return. See get_filename_component(). If POST_INSTALL_RELATIVE is given as argument, VAR is set to the path of the installed file relative to the installation prefix. Similarly, POST_INSTALL sets VAR to the absolute path of the installed file post installation.
Returns:
Path of output file similar to LOCATION property of CMake targets.
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#prop_tgt:LOCATION
function basis_get_target_name ( in  TARGET_NAME,
in  TARGET_UID 
)

Get "local" target name, i.e., BASIS target name.

Parameters:
[out]TARGET_NAMETarget name used as argument to BASIS functions.
[in]TARGET_UID"Global" target name, i.e., actual CMake target name.
Returns:
Sets TARGET_NAME to the name of the build target with UID TARGET_UID.
See also:
basis_get_target_uid()
function basis_get_target_namespace ( in  TARGET_NS,
in  TARGET_UID 
)

Get namespace of build target.

Parameters:
[out]TARGET_NSNamespace part of target UID.
[in]TARGET_UIDTarget UID/name.
function basis_get_target_type ( in  TYPE,
in  TARGET_NAME 
)

Get type name of target.

Parameters:
[out]TYPEThe target's type name or NOTFOUND.
[in]TARGET_NAMEThe name of the target.
function basis_get_target_uid ( in  TARGET_UID,
in  TARGET_NAME 
)

Get "global" target name, i.e., actual CMake target name.

In order to ensure that CMake target names are unique across modules of a BASIS project, the target name given to the BASIS CMake functions is converted by basis_make_target_uid() into a so-called target UID which is used as actual CMake target name. This function can be used to get for a given target name or UID the closest match of a known target UID.

In particular, if this project is a module of another BASIS project, the namespace given by PROJECT_NAMESPACE_CMAKE is used as prefix, where the namespace prefix and the build target name are separated by a dot (.). Otherwise, if this project is the top-level project, no namespace prefix is used and if the project's namespace is given as prefix, it will be removed. When the target is exported, however, the namespace of this project will be prefixed again. This is done by the basis_export_targets() function.

Note that names of imported targets are not prefixed in any case.

The counterpart basis_get_target_name() can be used to convert the target UID back to the target name without namespace prefix.

Note:
At the moment, BASIS does not support modules which themselves have modules again. This would require a more nested namespace hierarchy.
Parameters:
[out]TARGET_UID"Global" target name, i.e., actual CMake target name.
[in]TARGET_NAMETarget name used as argument to BASIS CMake functions.
Returns:
Sets TARGET_UID to the UID of the build target TARGET_NAME.
See also:
basis_get_target_name()
macro basis_get_test_name ( in  TEST_NAME,
in  TEST_UID 
)

Get "local" test name, i.e., BASIS test name.

Parameters:
[out]TEST_NAMETest name used as argument to BASIS functions.
[in]TEST_UID"Global" test name, i.e., actual CTest test name.
Returns:
Sets TEST_NAME to the name of the test with UID TEST_UID.
See also:
basis_get_test_uid()
macro basis_get_test_namespace ( in  TEST_NS,
in  TEST_UID 
)

Get namespace of test.

Parameters:
[out]TEST_NSNamespace part of test UID. If TEST_UID is no UID, i.e., does not contain a namespace part, the namespace of this project is returned.
[in]TEST_UIDTest UID/name.
macro basis_get_test_uid ( in  TEST_UID,
in  TEST_NAME 
)

Get "global" test name, i.e., actual CTest test name.

In order to ensure that CTest test names are unique across BASIS projects, the test name used by a developer of a BASIS project is converted by this function into another test name which is used as acutal CTest test name.

The function basis_get_test_name() can be used to convert the unique test name, the test UID, back to the original test name passed to this function.

Parameters:
[out]TEST_UID"Global" test name, i.e., actual CTest test name.
[in]TEST_NAMETest name used as argument to BASIS CMake functions.
Returns:
Sets TEST_UID to the UID of the test TEST_NAME.
See also:
basis_get_test_name()
function basis_install_links ( )

Adds installation rules to create default symbolic links.

This function creates for each main executable a symbolic link directly in the directory INSTALL_PREFIX/bin if INSTALL_SINFIX is TRUE and the software is installed on a Unix-like system, i.e., one which supports the creation of symbolic links.

Returns:
Adds installation command for creation of symbolic links in the installation tree.
macro basis_installtree_asserts ( in  ARGN)

Ensure certain requirements on install tree.

Requirements:

  • Prefix must be an absolute path.
  • Install tree must be different from source and build tree.
Parameters:
[in]ARGNNot used.
Returns:
Nothing.
function basis_list_to_delimited_string ( in  STR,
in  DELIM,
in  ARGN 
)

Concatenates all list elements into a single delimited string.

Parameters:
[out]STROutput string.
[in]DELIMDelimiter used to separate list elements. Each element which contains the delimiter as substring is surrounded by double quotes (") in the output string.
[in]ARGNInput list.
Returns:
Sets STR to the resulting string.
macro basis_list_to_regex ( in  REGEX,
in  ARGN 
)

Convert list into regular expression.

This function is in particular used to convert a list of property names such as <CONFIG>_OUTPUT_NAME, e.g., the list BASIS_PROPERTIES_ON_TARGETS, into a regular expression which can be used in pattern matches.

Parameters:
[out]REGEXName of variable for resulting regular expression.
[in]ARGNList of patterns which may contain placeholders in the form of "<this is a placeholder>". These are replaced by the regular expression "[^ ]+".
function basis_list_to_string ( in  STR,
in  ARGN 
)

Concatenates all list elements into a single string.

The list elements are concatenated without any delimiter in between. Use basis_list_to_delimited_string() to specify a delimiter such as a whitespace character or comma (,) as delimiter.

Parameters:
[out]STROutput string.
[in]ARGNInput list.
Returns:
Sets STR to the resulting string.
See also:
basis_list_to_delimited_string()
macro basis_make_target_uid ( in  TARGET_UID,
in  TARGET_NAME 
)

Make target UID from given target name.

This function is intended for use by the basis_add_*() functions only.

Parameters:
[out]TARGET_UID"Global" target name, i.e., actual CMake target name.
[in]TARGET_NAMETarget name used as argument to BASIS CMake functions.
Returns:
Sets TARGET_UID to the UID of the build target TARGET_NAME.
See also:
basis_get_target_uid()
macro basis_make_test_uid ( in  TEST_UID,
in  TEST_NAME 
)

Make test UID from given test name.

This function is intended for use by the basis_add_test() only.

Parameters:
[out]TEST_UID"Global" test name, i.e., actual CTest test name.
[in]TEST_NAMETest name used as argument to BASIS CMake functions.
Returns:
Sets TEST_UID to the UID of the test TEST_NAME.
See also:
basis_get_test_uid()
function basis_mexext ( in  ARGN)

Determine extension of MEX-files for this architecture.

Parameters:
[out]ARGNThe first argument ARGV0 is set to the extension of MEX-files (excluding '.'). If the CMake variable MEX_EXT is set, its value is returned. Otherwise, this function tries to determine it from the system information. If the extension could not be determined, an empty string is returned. If no argument is given, the extension is cached as the variable MEX_EXT.
Returns:
Sets the variable named by the first argument to the platform-specific extension of MEX-files.
function basis_normalize_name ( in  OUT,
in  STR 
)

Convert string to lowercase only or mixed case.

Strings in all uppercase or all lowercase are converted to all lowercase letters because these are usually used for acronymns. All other strings are returned unmodified with the one exception that the first letter has to be uppercase for mixed case strings.

This function is in particular used to normalize the project name for use in installation directory paths and namespaces.

Parameters:
[out]OUTString in CamelCase.
[in]STRString.
function basis_process_generator_expressions ( in  ARGS,
in  ARGN 
)

Process generator expressions in arguments.

This command evaluates the $<TARGET_FILE:tgt> and related generator expressions also for custom targets such as scripts and MATLAB Compiler targets. For other generator expressions whose argument is a target name, this function replaces the target name by the target UID, i.e., the actual CMake target name such that the expression can be evaluated by CMake. The following generator expressions are directly evaluated by this function:

$<TARGET_FILE:tgt> Absolute file path of built target.
$<TARGET_FILE_POST_INSTALL:tgt> Absolute path of target file after installation using the current INSTALL_PREFIX.
$<TARGET_FILE_POST_INSTALL_RELATIVE:tgt> Path of target file after installation relative to INSTALL_PREFIX.

Additionally, the suffix _NAME or _DIR can be appended to the name of each of these generator expressions to get only the basename of the target file including the extension or the corresponding directory path, respectively.

Generator expressions are in particular supported by basis_add_test().

Parameters:
[out]ARGSName of output list variable.
[in]ARGNList of arguments to process.
See also:
basis_add_test()
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:add_test
macro basis_project_finalize ( )

Finalize build configuration of project.

This macro has to be called at the end of the root CMakeLists.txt file of each BASIS project initialized by basis_project().

The project configuration files are generated by including the CMake script PROJECT_CONFIG_DIR/GenerateConfig.cmake when this file exists or using the default script of BASIS.

Returns:
Finalizes addition of custom build targets, i.e., adds the custom targets which actually perform the build of these targets. See basis_add_custom_finalize() function.
See also:
basis_project_initialize()
macro basis_project_initialize ( )

Initialize project, calls CMake's project() command.

See also:
basis_project()
basis_project_impl()
Returns:
Sets the following non-cached CMake variables:
Return values:
PROJECT_NAME_LOWERProject name in all lowercase letters.
PROJECT_NAME_UPPERProject name in all uppercase letters.
PROJECT_NAME_INFIXProject name used as infix for installation directories and namespace identifiers. In particular, the project name in either all lowercase or mixed case starting with an uppercase letter depending on whether the PROJECT_NAME has mixed case or not.
PROJECT_REVISIONRevision number of Subversion controlled source tree or 0 if the source tree is not under revision control.
PROJECT_VERSION_AND_REVISIONA string of project version and revision that can be used for the output of version information. The format of this string is either one of the following:
  • "version 1.0.0 (revision 42)"
  • "version 1.0.0" (if revision unknown)
  • "revision 42" (if version is 0.0.0)
  • "version unknown" (otherwise)
macro basis_project_modules ( )

Initialize project modules.

Most parts of this macro were copied from the ITK4 project (http://www.vtk.org/Wiki/ITK_Release_4), in particular, the top-level CMakeLists.txt file. This file does not state any specific license, but the ITK package itself is released under the Apache License Version 2.0, January 2004 (http://www.apache.org/licenses/).

Attention:
At this point, the project-specific variables have not been set yet. For example, use CMAKE_CURRENT_SOURCE_DIR instead of PROJECT_SOURCE_DIR.
macro basis_sanitize_for_regex ( in  OUT,
in  STR 
)

Sanitize string variable for use in regular expression.

Note:
This function may not work for all cases, but is used in particular to sanitize project names, target names, namespace identifiers,...
Parameters:
[out]OUTString that can be used in regular expression.
[in]STRString to sanitize.
macro basis_set_if_empty ( in  VAR,
in  ARGN 
)

Set value of variable only if variable is not set already.

Parameters:
[out]VARName of variable.
[in]ARGNArguments to set() command excluding variable name.
Returns:
Sets VAR if its value was not valid before.
macro basis_set_if_not_set ( in  VAR,
in  ARGN 
)

Set value of variable only if variable is not defined yet.

Parameters:
[out]VARName of variable.
[in]ARGNArguments to set() command excluding variable name.
Returns:
Sets VAR if it was not defined before.
function basis_set_or_update_cache ( in  VAR)

Set variable.

If the variable is cached, this function will update the cache value, otherwise, it simply sets the CMake variable uncached to the given value(s).

function basis_set_project_property ( )

Set project-global property.

Set property associated with current project/module. The property is in fact just a cached variable whose name is prefixed by the project's name.

function basis_string_to_list ( in  LST,
in  STR 
)

Splits a string at space characters into a list.

Todo:
Probably this can be done in a better way... Difficulty is, that string(REPLACE) does always replace all occurrences. Therefore, we need a regular expression which matches the entire string. More sophisticated regular expressions should do a better job, though.
Parameters:
[out]LSTOutput list.
[in]STRInput string.
Returns:
Sets LST to the resulting CMake list.
function basis_svn_get_last_changed_revision ( in  URL,
in  REV 
)

Get revision number when directory or file was last changed.

Parameters:
[in]URLAbsolute path of directory or file. May also be a URL to the directory or file in the repository. A leading "file://" is automatically removed such that the svn command treats it as a local path.
[out]REVRevision number when URL was last modified. If URL is not under Subversion control or Subversion_SVN_EXECUTABLE is invalid, "0" is returned.
Returns:
Sets REV to revision number at which the working copy/repository specified by the URL URL was last modified.
function basis_svn_get_revision ( in  URL,
in  REV 
)

Get current revision of file or directory.

Parameters:
[in]URLAbsolute path of directory or file. May also be a URL to the directory or file in the repository. A leading "file://" is automatically removed such that the svn command treats it as a local path.
[out]REVThe revision number of URL. If URL is not under revision control or Subversion_SVN_EXECUTABLE is invalid, "0" is returned.
Returns:
Sets REV to the revision of the working copy/repository at URL URL.
function basis_svn_status ( in  URL,
in  STATUS 
)

Get status of revision controlled file.

Parameters:
[in]URLAbsolute path of directory or file. May also be a URL to the directory or file in the repository. A leading "file://" will be removed such that the svn command treats it as a local path.
[out]STATUSThe status of URL as returned by 'svn status'. If the local directory or file is unmodified, an empty string is returned. An empty string is also returned when Subversion_SVN_EXECUTABLE is invalid.
Returns:
Sets STATUS to the output of the svn info command.
function basis_update_imported_location ( in  TARGET,
in  PROPERTY,
in  LOCATION 
)

Update location of imported target.

Parameters:
[in]TARGETName (UID) of the imported target.
[in]PROPERTYTarget location property. Either IMPORTED_LOCATION or IMPORTED_LOCATION_<config>, where <config> is one of the imported build configurations. This argument is used to decide whether to keep the current target information or to replace it by the new one.
[in]LOCATIONLocation of imported target.
function basis_update_imported_type ( in  TARGET,
in  TYPE 
)

Update type of imported target.

This function is in particular called in basis_set_target_properties() if the BASIS_TYPE property of custom BASIS targets is set after the imported target was added with the initial type UNKNOWN.

Parameters:
[in]TARGETName (UID) of the imported target.
[in]TYPEType of imported target.
function basis_use_auxiliary_sources ( in  SOURCES_LIST,
in  HEADERS_LIST 
)

Add include directories of auxiliary sources to search path.

Parameters:
[in]SOURCES_LISTName of list of source files.
[in]HEADERS_LISTName of list of header files.
function basis_version_numbers ( in  VERSION,
in  MAJOR,
in  MINOR,
in  PATCH 
)

Extract version numbers from version string.

Parameters:
[in]VERSIONVersion string in the format "MAJOR[.MINOR[.PATCH]]".
[out]MAJORMajor version number if given or 0.
[out]MINORMinor version number if given or 0.
[out]PATCHPatch number if given or 0.
Returns:
See [out] parameters.
function get_filename_component ( in  ARGN)

Fixes CMake's get_filename_component() command.

The get_filename_component() command of CMake returns the entire portion after the first period (.) [including the period] as extension. However, only the component following the last period (.) [including the period] should be considered to be the extension.

Note:
Consider the use of the basis_get_filename_component() macro as an alias to emphasize that this function is different from CMake's get_filename_component() command.
Parameters:
[in,out]ARGNArguments as accepted by get_filename_component().
Returns:
Sets the variable named by the first argument to the requested component of the given file path.
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:get_filename_component
basis_get_filename_component()
macro include_directories ( in  ARGN)

Add directories to search path for include files.

Overwrites CMake's include_directories() command. This is required because the basis_include_directories() function is not used by other projects in their package use files. Therefore, this macro is an alias for basis_include_directories().

Parameters:
[in]ARGNList of arguments for basis_include_directories().
Returns:
Adds the given paths to the search path for include files.
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:include_directories
macro link_directories ( in  ARGN)

Add directories to search path for libraries.

Overwrites CMake's link_directories() command. This is required because the basis_link_directories() function is not used by other projects in their package use files. Therefore, this macro is an alias for basis_link_directories().

Parameters:
[in]ARGNList of arguments for basis_link_directories().
Returns:
Adds the given paths to the search path for libraries.
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:link_directories
function set_target_properties ( in  ARGN)

Set target property.

This function is overwritten by BASIS in order to update the information about imported build targets.

Note:
Do not use this function in your CMakeLists.txt configuration files. Use basis_set_target_properties() instead.
Due to a bug in CMake (http://www.cmake.org/Bug/view.php?id=12303), except of the first property given directly after the PROPERTIES keyword, only properties listed in BASIS_PROPERTIES_ON_TARGETS can be set.
Parameters:
[in]ARGNList of arguments for set_target_properties().
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:set_target_properties