BASIS  r3148
CMake Utilities

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_UID, in ARGN)
 Add executable target.
function add_library (in TARGET_UID, in ARGN)
 Add library target.
macro basis_add_custom_target (in TARGET_NAME)
 Add custom target.
function basis_add_executable_target (in TARGET_NAME, in ARGN)
 Add executable built from C++ source code.
function basis_add_glob_target (in TARGET_UID, out SOURCES, in ARGN)
 Glob source files.
function basis_add_imported_target (in TARGET, in TYPE)
 Add imported target.
function basis_add_init_py_target ()
function basis_add_library_target (in TARGET_NAME, in ARGN)
 Add library built from C++ source code.
function basis_add_mcc_target (in TARGET_NAME, in ARGN)
 Add MATLAB Compiler target.
function basis_add_mex_file (in TARGET_NAME, in ARGN)
 Add MEX-file target.
function basis_add_script_library (in TARGET_NAME, in ARGN)
 Add script library target.
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.
function basis_add_utilities_library (out UID)
 Add build target for BASIS C++ utilities library.
function basis_build_mcc_target (in TARGET_UID)
 Add custom command for build of MATLAB Compiler target.
function basis_build_mex_file (in TARGET_UID)
 Add custom command for build of MEX-file.
function basis_build_script (in TARGET_UID)
 Add custom command for build of single script.
function basis_build_script_library (in TARGET_UID)
 Add custom command for build of script library.
function 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.
macro basis_compare_lists (out RESULT, in LIST1, in LIST2)
 Compare two lists.
macro basis_compile_python_modules_for_jython (out FLAG)
 Whether to compile Python modules for Jython interpreter.
function basis_configure_public_headers ()
 Configure public header files.
macro basis_configure_root_documentation_files ()
 Configure root documentation files.
function basis_configure_script (in INPUT, in OUTPUT, in ARGN)
 Configure and optionally compile script file.
function basis_configure_script_libraries ()
 Add library targets for the public modules in PROJECT_LIBRARY_DIR.
function basis_configure_sources (out LIST_NAME, in ARGN)
 Configure .in source files.
function basis_configure_utilities ()
 Configure BASIS utilities.
function basis_create_addpaths_mfile ()
 This function writes a MATLAB M-file with addpath() statements.
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.
macro basis_exists_target (out RESULT_VARIABLE, in TARGET_NAME)
 Whether a given target exists.
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.
function basis_finalize_targets ()
 Finalize custom targets by adding the missing build commands.
macro basis_find_packages ()
 Find packages this project depends on.
function basis_get_bash_version (out ARGV1)
 Get version of Bash interpreter.
function basis_get_build_timestamp (in TIMESTAMP)
 Get build time stamp.
function basis_get_compiled_file (out CFILE, in SOURCE, in ARGV2)
 Get file name of compiled script.
macro basis_get_compiled_jython_file_of_python_module (out CFILE, in MODULE)
 Get file path of Jython file compiled from the given Python module.
function basis_get_full_matlab_version (out VERSION)
 Determine version of MATLAB installation.
function basis_get_fully_qualified_target_uid (out TARGET_UID, in TARGET_NAME)
 Get fully-qualified target name.
function basis_get_fully_qualified_test_uid (out TEST_UID, in TEST_NAME)
 Get "global" test name, i.e., actual CTest test name.
function basis_get_jython_version (out ARGV1)
 Get version of Jython interpreter.
function basis_get_matlab_release (out ARGV1)
 Get release version of MATLAB installation.
function basis_get_matlab_version (out ARGV1)
 Get version of MATLAB installation.
function basis_get_perl_version (out ARGV1)
 Get version of Perl interpreter.
function basis_get_project_property (out VARIABLE, in ARGN)
 Get project-global property value.
function basis_get_python_version (out ARGV1)
 Get version of Python interpreter.
function basis_get_soname (out SONAME, in OBJFILE)
 Get soname of object file.
function basis_get_source_language (out LANGUAGE, in ARGN)
 Detect programming language of given source code files.
function basis_get_source_target_name (out TARGET_NAME, in SOURCE_FILE, in ARGN)
 Derive target name from source file name.
function basis_get_target_link_libraries (out LINK_DEPENDS, in TARGET_NAME)
 Get link libraries/dependencies of (imported) target.
function basis_get_target_location (out VAR, in TARGET_NAME, in PART)
 Get location of build target output file(s).
function basis_get_target_name (out TARGET_NAME, in TARGET_UID)
 Get "local" target name, i.e., BASIS target name.
function basis_get_target_namespace (out TARGET_NS, in TARGET_UID)
 Get namespace of build target.
function basis_get_target_type (out TYPE, in TARGET_NAME)
 Get type name of target.
function basis_get_target_uid (out TARGET_UID, in TARGET_NAME)
 Get "global" target name, i.e., actual CMake target name.
macro basis_get_test_name (out TEST_NAME, in TEST_UID)
 Get "local" test name, i.e., BASIS test name.
macro basis_get_test_namespace (out TEST_NS, in TEST_UID)
 Get namespace of test.
function basis_get_test_uid (out 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_install_public_headers ()
 Add installation rules for public header files.
function basis_installtree_asserts (in ARGN)
 Ensure certain requirements on install tree.
macro basis_is_cached (out VAR, in ENTRY)
 Determine if cache entry exists.
macro basis_library_prefix (out PREFIX, in LANGUAGE)
 Get default subdirectory prefix of scripted library modules.
function basis_list_to_delimited_string (out STR, in DELIM, in ARGN)
 Concatenates all list elements into a single delimited string.
macro basis_list_to_regex (out REGEX, in ARGN)
 Convert list into regular expression.
function basis_list_to_string (out STR, in ARGN)
 Concatenates all list elements into a single string.
macro basis_make_target_uid (out TARGET_UID, in TARGET_NAME)
 Make target UID from given target name.
macro basis_make_test_uid (out TEST_UID, in TEST_NAME)
 Make test UID from given test name.
function basis_mexext (out ARGN)
 Determine extension of MEX-files for this architecture.
macro basis_module_check (in MODULE, in NEEDED_BY, in STACK)
macro basis_module_enable (in MODULE, in NEEDED_BY)
function basis_normalize_name (out OUT, in STR)
 Convert string to lowercase only or mixed case.
function basis_process_generator_expressions (out ARGS, in ARGN)
 Process generator expressions in arguments.
macro basis_project_initialize ()
 Initialize project, calls CMake's project() command.
macro basis_project_modules ()
 Initialize project modules.
function basis_register_package ()
 Register installed package with CMake.
macro basis_sanitize_for_regex (out OUT, in STR)
 Sanitize string variable for use in regular expression.
macro basis_set_flag (in PREFIX, out FLAG, in DEFAULT)
 Set flag given mutually exclusive ARGN_<FLAG> and ARGN_NO<FLAG> function arguments.
macro basis_set_if_empty (out VAR, in ARGN)
 Set value of variable only if variable is not set already.
macro basis_set_if_not_set (out VAR, in ARGN)
 Set value of variable only if variable is not defined yet.
macro basis_set_or_update_type (in VAR, in TYPE, in ARGN)
 Set type of variable.
macro basis_set_or_update_value (in VAR)
 Set variable value.
function basis_set_project_property ()
 Set project-global property.
function basis_set_target_install_rpath (in TARGET_NAME)
 Set INSTALL_RPATH property of executable or shared library target.
macro basis_slicer_module_initialize ()
 Initialize slicer module meta-data.
function basis_slicer_module_to_extension_metadata ()
 Copy MODULE_* metadata to EXTENSION_* metadata of Slicer Extension.
function basis_string_to_list (out LST, in STR)
 Splits a string at space characters into a list.
function basis_svn_get_last_changed_revision (in URL, out REV)
 Get revision number when directory or file was last changed.
function basis_svn_get_revision (in URL, out REV)
 Get current revision of file or directory.
function basis_svn_status (in URL, out STATUS)
 Get status of revision controlled file.
function basis_tokenize_dependency (in DEP, out PKG, out VER, out CMP)
 Tokenize dependency specification.
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.
macro basis_update_type_of_variable (in VAR, in TYPE)
 Change type of cached variable.
macro basis_update_value (in VAR)
 Update cache variable.
function basis_utilities_check (out VAR, in SOURCE_FILE, in ARGN)
 Check whether the BASIS utilities are used within a given source file.
function basis_version_numbers (in VERSION, out MAJOR, out MINOR, out PATCH)
 Extract version numbers from version string.
macro basis_write_addpaths_mfile (in MFILE, in ARGN)
 This function writes a MATLAB M-file with addpath() statements.
function basis_write_list (in FILENAME, in VARIABLE)
 Write CMake script file which sets the named variable to the specified (list of) values.
macro find_package ()
 Overloaded find_package() command.
function get_filename_component (inout 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

option BUILD_ALL_MODULES = OFF
cmake CONFIG_FILE
 Name of the CMake package configuration file.
cmake CONFIG_PREFIX
 Package name.
cmake CUSTOM_EXPORTS_FILE
 Name of the CMake target exports file for custom targets.
cmake EXPORTS_FILE
 Name of the CMake target exports file.
cmake PROJECT_MODULES_DISABLED
cmake PROJECT_MODULES_ENABLED
cmake USE_FILE
 Name of the CMake package use file.
cmake VERSION_FILE
 Name of the CMake package version file.

Detailed Description

Utilities implementated by the CMake modules.

Names of recognized properties on tests.

Unfortunately, the ARGV and ARGN arguments of a CMake function() or macro() does not preserve values which themselves are lists. Therefore, it is not possible to distinguish between property names and their values in the arguments passed to basis_set_tests_properties(). To overcome this problem, this list specifies all the possible property names. Everything else is considered to be a property value except the first argument follwing right after the PROPERTIES keyword. Alternatively, basis_set_property() can be used as here no disambiguity exists.

Note:
Placeholders such as <CONFIG> are allowed. These are treated as the regular expression "[^ ]+". See basis_list_to_regex().
See also:
http://www.cmake.org/cmake/help/cmake-2-8-docs.html#section_PropertiesonTests

Function Documentation

function add_executable ( in  TARGET_UID,
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]TARGET_UIDName 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
Returns:
Nothing.
function add_library ( in  TARGET_UID,
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]TARGET_UIDName 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
Returns:
Nothing.
macro basis_add_custom_target ( in  TARGET_NAME)

Add custom target.

Returns:
Nothing.
function basis_add_executable_target ( in  TARGET_NAME,
in  ARGN 
)

Add executable built from C++ source code.

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++).

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. If none of the BASIS C++ utilities are used by this target, the option NO_BASIS_UTILITIES can be given. To enable this option by default, set the variable BASIS_UTILITIES to FALSE, best in the Settings.cmake file located in the PROJECT_CONFIG_DIR (add such file if missing). If the use of the BASIS C++ utilities is disabled by default, the USE_BASIS_UTILITIES option can be used to enable them for this target only. Note that the utilities library is a static library and thus the linker would simply not include any of the BASIS utility functions in the final binary file if not used. The only advantage of setting BASIS_UTILITIES to FALSE or to always specify NO_BASIS_UTILITIES if no target uses the utilities is that the BASIS utilities library will not be build in this case.

Parameters:
[in]TARGET_NAMEName of build target.
[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.
COMPONENT name Name of component as part of which this executable will be installed if the specified DESTINATION is not "none". (default: BASIS_RUNTIME_COMPONENT)
DESTINATION dir Installation directory relative to CMAKE_INSTALL_PREFIX. If "none" (case-insensitive) is given as argument, no default installation rules are added for this executable target. (default: INSTALL_RUNTIME_DIR or INSTALL_LIBEXEC_DIR if LIBEXEC is given)
LIBEXEC Specifies that the built executable is an auxiliary executable which is only called by other executables. (default: FALSE)
[NO]EXPORT Whether to export this target. (default: TRUE)
NO_BASIS_UTILITIES Specify that the BASIS utilities are not used by this executable and hence no link dependency on the BASIS utilities library shall be added. (default: NOT BASIS_UTILITIES)
USE_BASIS_UTILITIES Specify that the BASIS utilities are used and required by this executable and hence a link dependency on the BASIS utilities library has to be added. (default: BASIS_UTILITIES)
Returns:
Adds executable target using CMake's add_executable() command.
See also:
basis_add_executable()
function basis_add_glob_target ( in  TARGET_UID,
out  SOURCES,
in  ARGN 
)

Glob source files.

This function gets a list of source files and globbing expressions, evaluates the globbing expression, and replaces these by the found source files such that the resulting list of source files contains only absolute paths of source files. It is used by basis_add_executable() and basis_add_library() to get a list of all source files. The syntax for the glob expressions corresponds to the one used by CMake's file(GLOB) command. Additionally, if the pattern ** is found in a glob expression, it is replaced by a single * and the recursive version, i.e., file(GLOB_RECURSE), is used instead.

Parameters:
[in]TARGET_UIDUID of build target which builds the globbed source files. The custom target which re-globs the source files before each build of this target is named after this build target with two leading underscores (__).
[out]SOURCESList of absolute source paths.
[in]ARGNInput file paths and/or globbing expressions.
See also:
basis_add_executable()
basis_add_library()
Returns:
Nothing.
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()
Returns:
Nothing.
function basis_add_init_py_target ( )
Returns:
Nothing.
function basis_add_library_target ( in  TARGET_NAME,
in  ARGN 
)

Add library built from C++ source code.

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.

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.

By default, the BASIS C++ utilities library is added as link dependency. If none of the BASIS C++ utilities are used by this target, the option NO_BASIS_UTILITIES can be given. To enable this option by default, set the variable BASIS_UTILITIES to FALSE, best in the Settings.cmake file located in the PROJECT_CONFIG_DIR (add such file if missing). If the use of the BASIS C++ utilities is disabled by default, the USE_BASIS_UTILITIES option can be used to enable them for this target only. Note that the utilities library is a static library and thus the linker would simply not include any of the BASIS utility functions in the final binary file if not used. The only advantage of setting BASIS_UTILITIES to FALSE or to always specify NO_BASIS_UTILITIES if no target uses the utilities is that the BASIS utilities library will not be build in this case.

Parameters:
[in]TARGET_NAMEName of build target.
[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. (default: SHARED if BUILD_SHARED_LIBS evaluates to true or STATIC otherwise)
COMPONENT name Name of component as part of which this library will be installed if either the RUNTIME_INSTALL_DIRECTORY or LIBRARY_INSTALL_DIRECTORY property is not "none". Used only if either RUNTIME_COMPONENT or LIBRARY_COMPONENT not specified. (default: see RUNTIME_COMPONENT and LIBRARY_COMPONENT)
DESTINATION dir Installation directory for runtime and library component relative to CMAKE_INSTALL_PREFIX. Used only if either RUNTIME_DESTINATION or LIBRARY_DESTINATION not specified. If "none" (case-insensitive) is given as argument, no default installation rules are added. (default: see RUNTIME_DESTINATION and LIBRARY_DESTINATION)
LIBRARY_COMPONENT name Name of component as part of which import/static library will be intalled if LIBRARY_INSTALL_DIRECTORY property is not "none". (default: COMPONENT if specified or BASIS_LIBRARY_COMPONENT otherwise)
LIBRARY_DESTINATION dir Installation directory of the library component relative to CMAKE_INSTALL_PREFIX. If "none" (case-insensitive) is given as argument, no installation rule for the library component is added. (default: INSTALL_ARCHIVE_DIR)
RUNTIME_COMPONENT name Name of component as part of which runtime library will be installed if RUNTIME_INSTALL_DIRECTORY property is not "none". (default: COMPONENT if specified or BASIS_RUNTIME_COMPONENT otherwise)
RUNTIME_DESTINATION dir Installation directory of the runtime component relative to CMAKE_INSTALL_PREFIX. If "none" (case-insensitive) is given as argument, no installation rule for the runtime library is added. (default: INSTALL_LIBRARY_DIR on Unix or INSTALL_RUNTIME_DIR Windows)
[NO]EXPORT Whether to export this target. (default: TRUE)
NO_BASIS_UTILITIES Specify that the BASIS utilities are not used by this executable and hence no link dependency on the BASIS utilities library shall be added. (default: NOT BASIS_UTILITIES)
USE_BASIS_UTILITIES Specify that the BASIS utilities are used and required by this executable and hence a link dependency on the BASIS utilities library shall be added. (default: BASIS_UTILITIES)
Returns:
Adds library target using CMake's add_library() command.
See also:
basis_add_library()
function basis_add_mcc_target ( in  TARGET_NAME,
in  ARGN 
)

Add MATLAB Compiler target.

Note:
This function should not be used directly. Instead, it is called by either basis_add_executable() or basis_add_library() if the (detected) programming language of the given source code files is MATLAB.

This function is used to add an executable or shared library target which is built using the MATLAB Compiler (MCC).

A custom CMake build target with the following properties is added by this function to the build system. These properties are used by basis_build_mcc_target() to generate a build script written in CMake code which is executed by a custom CMake command. Before the invokation of basis_build_mcc_target(), the target properties can be modified using basis_set_target_properties().

Note:
Custom BASIS build targets are finalized by BASIS at the end of basis_project_impl(), i.e., the end of the root CMake configuration file of the (sub-)project.
Properties on MATLAB Compiler targets
TODO

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 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:
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 the value of the EXPORT property.
Parameters:
[in]TARGET_NAMEName of build target.
[in]ARGNThe remaining arguments are parsed and the following arguments extracted. All unparsed arguments are treated as the MATLAB or C/C++ source files, respectively.
EXECUTABLE|LIBEXEC|SHARED Type of the MATLAB Compiler target which can be either a stand-alone executable, an auxiliary executable, or a shared library. (default: EXECUTABLE)
COMPONENT name Name of component as part of which this executable or library will be installed if the RUNTIME_INSTALL_DIRECTORY or LIBRARY_INSTALL_DIRECTORY property is not "none". Used only if RUNTIME_COMPONENT or LIBRARY_COMPONENT not specified. (default: see RUNTIME_COMPONENT and LIBRARY_COMPONENT arguments)
DESTINATION dir Installation directory for executable or runtime and library component of shared library relative to CMAKE_INSTALL_PREFIX. Used only if RUNTIME_DESTINATION or LIBRARY_DESTINATION not specified. If "none" (case-insensitive) is given as argument, no default installation rules are added. (default: see RUNTIME_DESTINATION and LIBRARY_DESTINATION arguments)
LIBRARY_COMPONENT name Name of component as part of which import/static library will be intalled if a shared library is build and the LIBRARY_INSTALL_DIRECTORY property is not "none". (default: COMPONENT if specified or BASIS_LIBRARY_COMPONENT otherwise)
LIBRARY_DESTINATION dir Installation directory of the library component relative to CMAKE_INSTALL_PREFIX. If "none" (case-insensitive) is given as argument or an executable is build, no installation rule for the library component is added. (default: INSTALL_ARCHIVE_DIR)
RUNTIME_COMPONENT name Name of component as part of which executable or runtime library, respectively, will be installed if the RUNTIME_INSTALL_DIRECTORY property is not "none". (default: COMPONENT if specified or BASIS_RUNTIME_COMPONENT otherwise)
RUNTIME_DESTINATION dir Installation directory of the executable or runtime component of the shared library relative to CMAKE_INSTALL_PREFIX. If "none" (case-insensitive) is given as argument, no installation rule for the runtime library is added. (default: INSTALL_LIBRARY_DIR for shared libraries on Unix or INSTALL_RUNTIME_DIR otherwise)
[NO]EXPORT Whether to export this target. (default: TRUE)
NO_BASIS_UTILITIES Specify that the BASIS utilities are not used by this executable or shared library and hence no link dependency on the BASIS utilities shall be added. (default: NOT BASIS_UTILITIES)
USE_BASIS_UTILITIES Specify that the BASIS utilities are used and required by this executable or shared library, respectively, and hence a link dependency on the BASIS utilities must be added. (default: BASIS_UTILITIES)
Todo:
Consider NO_BASIS_UTILITIES and USE_BASIS_UTILITIES options after the BASIS utilities for MATLAB have been implemented.
Returns:
Adds custom target which builds depending on the BASIS_TYPE property either an executable or a shared library using the MATLAB Compiler.
See also:
basis_add_executable()
basis_add_library()
function basis_add_mex_file ( in  TARGET_NAME,
in  ARGN 
)

Add MEX-file 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 MEX type option is given.

This function is used to add a shared library target which is built using the MATLAB MEX script (mex).

By default, the BASIS C++ utilities library is added as link dependency. If none of the BASIS C++ utilities are used by this target, the option NO_BASIS_UTILITIES can be given. To enable this option by default, set the variable BASIS_UTILITIES to FALSE, best in the Settings.cmake file located in the PROJECT_CONFIG_DIR (add such file if missing). If the use of the BASIS C++ utilities is disabled by default, the USE_BASIS_UTILITIES option can be used to enable them for this target only. Note that the utilities library is a static library and thus the linker would simply not include any of the BASIS utility functions in the final binary file if not used. The only advantage of setting BASIS_UTILITIES to FALSE or to always specify NO_BASIS_UTILITIES if no target uses the utilities is that the BASIS utilities library will not be build in this case.

A custom CMake build target with the following properties is added by this function to the build system. These properties are used by basis_build_mex_target() to generate a build script written in CMake code which is executed by a custom CMake command. Before the invokation of basis_build_mex_target(), the target properties can be modified using basis_set_target_properties().

Note:
Custom BASIS build targets are finalized by BASIS at the end of basis_project_impl(), i.e., the end of the root CMake configuration file of the (sub-)project.
Properties on script library targets
MFILE file MATLAB source file with function prototype and documentation of MEX-file. (default: none)
PREFIX prefix Output prefix of build MEX-file such as package name (the prefix must include the leading + and trailing /).
Attention:
Properties documented as read-only must not be modified.

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 specified COMPONENT in the INSTALL_LIBRARY_DIR on Unix and INSTALL_RUNTIME_DIR on Windows.

Parameters:
[in]TARGET_NAMEName of build target.
[in]ARGNThe remaining arguments are parsed and the following arguments extracted. All unparsed arguments are treated as the source files of the MEX-file.
COMPONENT name Name of installation component as part of which this MEX-file is being installed if the LIBRARY_INSTALL_DIRECTORY property is not "none". (default: BASIS_LIBRARY_COMPONENT)
[NO]EXPORT Whether to export this target. (default: TRUE)
NO_BASIS_UTILITIES Specify that the BASIS utilities are not used by this MEX-file and hence no link dependency on the BASIS utilities shall be added. (default: NOT BASIS_UTILITIES)
USE_BASIS_UTILITIES Specify that the BASIS utilities are used and required by this MEX-file and hence a link dependency on the BASIS utilities must be added. (default: BASIS_UTILITIES)
Returns:
Adds custom target to build MEX-file using the MEX script.
See also:
basis_add_library()
function basis_add_script_library ( in  TARGET_NAME,
in  ARGN 
)

Add script 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 neither CXX (i.e., C/C++) nor MATLAB.

This function adds a build target for libraries which are a collection of one or more modules written in a scripting language. The relative paths of the modules relative to the library's SOURCE_DIRECTORY property are preserved. This is important for the most widely used scripting languages such as Python, Perl, or MATLAB, where the file path relative to the package root directory defines the package namespace.

A custom CMake build target with the following properties is added by this function to the build system. These properties are used by basis_build_script_library() to generate a build script written in CMake code which is executed by a custom CMake command. Before the invokation of basis_build_script_library(), the target properties can be modified using basis_set_target_properties().

Note:
Custom BASIS build targets are finalized by BASIS at the end of basis_project_impl(), i.e., the end of the root CMake configuration file of the (sub-)project.
Properties on script library targets
BASIS_TYPE Read-only property with value "SCRIPT_LIBRARY" for script library targets.
BASIS_UTILITIES Whether the BASIS utilities are used by any module of this library. For the supported scripting languages for which BASIS utilities are implemented, BASIS will in most cases automatically detect whether these utilities are used by a module or not. Otherwise, set this property manually or use either the USE_BASIS_UTILITIES or the NO_BASIS_UTILITIES option when adding the library target. (default: auto-detected or UNKNOWN)
BINARY_DIRECTORY Build tree directory of this target. (default: CMAKE_CURRENT_BINARY_DIR)
COMPILE Whether to compile the library, respectively, it's modules if the programming language allows such pre-compilation as in case of Python, for example. If TRUE, only the compiled files are installed. (default: BASIS_COMPILE_SCRIPTS)
COMPILE_DEFINITIONS CMake code which is evaluated after the inclusion of the default script configuration files. This code can be used to set the replacement text of the CMake variables ("@VAR@" patterns) used in the source files. See Build System Standard for details. (default: "")
COMPILE_DEFINITIONS_FILE CMake script file with compile definitions, also referred to as script configuration file. The named files are included after the default BASIS script configuration and before the COMPILE_DEFINITIONS code is being evaluated. (default: BINARY_CONFIG_DIR/ScriptConfig.cmake)
EXPORT Whether to export this build target in which case an import library target is added to the custom exports file with the path to the built/installed modules set as IMPORT_LOCATION. (default: TRUE)
LANGUAGE Read-only property of programming language of modules in uppercase letters. (default: see LANGUAGE argument)
LIBRARY_COMPONENT Name of component as part of which this library is installed if LIBRARY_INSTALL_DIRECTORY is not set to "none". (default: see COMPONENT argument)
LIBRARY_INSTALL_DIRECTORY Installation directory of library configured for use in installation tree relative to CMAKE_INSTALL_PREFIX. Set to "none" (case-insensitive) to skip the addition of an installation rule. (default: INSTALL_<LANGUAGE>_LIBRARY_DIR if defined or INSTALL_LIBRARY_DIR otherwise)
LIBRARY_OUTPUT_DIRECTORY Output directory of library configured for use within the build tree. (default: BINARY_<LANGUAGE>_LIBRARY_DIR if defined or BINARY_LIBRARY_DIR otherwise)
LINK_DEPENDS Paths or target names of script modules and libraries used by this script. For each listed build target, a dependency is added between this library target and the named build targets. Use basis_target_link_libraries() to add additional link dependencies. Further note that if this library is a link dependency of an executable script added by basis_add_executable() (i.e., basis_add_script() actually), the link dependencies of this library are inherited by the executable script. (default: BASIS utilities module if used or empty list otherwise)
PREFIX Common module prefix. The given directory path is appended to both LIBRAR_OUTPUT_DIRECTORY and LIBRARY_INSTALL_DIRECTORY and can, for example, be used to install modules of a Python package as part of another Python package, where LIBRARY_OUTPUT_DIRECTORY or LIBRARY_INSTALL_DIRECTORY, respectively, is the directory of the main package which is added to the PYTHONPATH. Possibly missing __init__.py files in case of Python are generated by the _initpy target which is automatically added by BASIS in that case and further added to the dependencies of this library target. (default: PROJECT_NAMESPACE_PYTHON if LANGUAGE is PYTHON with periods (.) replaced by slashes (/), PROJECT_NAMESPACE_PERL if LANGUAGE is PERL with :: replaced by slashes (/), and "" otherwise)
SOURCE_DIRECTORY Source directory of this target. This directory is in particular used to convert the paths of the given source files to relative paths. The built modules within the build and installation tree will have the same relative path (relative to the LIBRARY_OUTPUT_DIRECTORY or LIBRARY_INSTALL_DIRECTORY, respectively). (default: CMAKE_CURRENT_SOURCE_DIR)
SOURCES Read-only property which lists the source files of this library. Note that the first element in this list actually names a directory in the build, the one where the build script for this target is located instead of a source file and thus should be ignored.
Attention:
Properties documented as read-only must not be modified.
Parameters:
[in]TARGET_NAMEName of build target.
[in]ARGNThe remaining arguments are parsed and the following arguments extracted. All unparsed arguments are treated as the module files of the script library.
COMPONENT name Name of installation component as part of which this library is being installed if the LIBRARY_INSTALL_DIRECTORY property is not "none". (default: BASIS_LIBRARY_COMPONENT)
DESTINATION dir Installation directory for library relative to CMAKE_INSTALL_PREFIX. If an absolute path is given as argument, it is made relative to the configured installation prefix. (default: INSTALL_LIBRARY_DIR)
LANGUAGE lang Programming language in which modules are written (case-insensitive). If not specified, the programming language is derived from the file name extensions of the source files and the shebang directive on the first line of each module if any. If the programming language could not be detected automatically, the LANGUAGE property is set to UNKNOWN. Note that for script library targets, the library may still be built correctly even if the scripting language was not recognized. The automatic detection whether the BASIS utilities are used and required will fail, however. In this case, specify the programming language using this option. (default: auto-detected or UNKNOWN)
[NO]EXPORT Whether to export this target. (default: TRUE)
NO_BASIS_UTILITIES Specify that the BASIS utilities are not used by this library. If the programming language of the modules is known and BASIS utilities are available for this language, BASIS will in most cases automatically detect whether these utilities are used by any module of this library. Use this option to skip this check in the case that no module makes use of the BASIS utilities.
USE_BASIS_UTILITIES Specify that the BASIS utilities are used and thus required by this library. If the programming language of the modules is known and BASIS utilities are available for this language, BASIS will in most cases automatically detect whether these utilities are used by any module of this library. Use this option to skip this check when it is already known that no module makes use of the BASIS utilities. Note that an error is raised if this option is given, but no BASIS utilities are available for the programming language of this script or if the programming language is unknown, respectively, not detected correctly. In this case, consider the use of the LANGUAGE argument.
Returns:
Adds a custom CMake target with the documented properties. The actual custom command to build the library is added by basis_build_script_library().
See also:
basis_add_library()
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.
function basis_add_utilities_library ( out  UID)

Add build target for BASIS C++ utilities library.

This function is called by the top-level project in order to add the "basis" build target for the static project-specific BASIS utilities library for C++. It is called by basis_project_impl() in the root CMakeLists.txt file of the top-level project.

The CMake function add_library() checks if the specified source code files exist. If a source file is not found, an error is raised by CMake. The BASIS utilities can, however, only be configured at the end of the configuration step. Therefore, this function simply writes dummy C++ source files in order to pass the existence check. The actual source files are configured by the function basis_configure_utilities().

After writing these dummy source files, a library build target for the project-specific BASIS C++ utilities is added. This build target is not being build as part of the ALL target in case it is never used by any of the build targets of the project. Only if build target links to this library, it will be build and installed.

Parameters:
[out]UIDUID of added build target.
Returns:
Nothing.
function basis_build_mcc_target ( in  TARGET_UID)

Add custom command for build of MATLAB Compiler target.

This function is called by basis_finalize_targets() which in turn is called at the end of basis_project_impl(), i.e., the end of the root CMake configuration file of the (sub-)project.

Parameters:
[in]TARGET_UIDName/UID of custom target added by basis_add_mcc_target().
See also:
basis_add_mcc_target()
Returns:
Nothing.
function basis_build_mex_file ( in  TARGET_UID)

Add custom command for build of MEX-file.

This function is called by basis_finalize_targets() which in turn is called at the end of basis_project_impl(), i.e., the end of the root CMake configuration file of the (sub-)project.

Parameters:
[in]TARGET_UIDName/UID of custom target added by basis_add_mex_file().
See also:
basis_add_mex_file()
Returns:
Nothing.
function basis_build_script ( in  TARGET_UID)

Add custom command for build of single script.

This function is called by basis_finalize_targets() which in turn is called at the end of basis_project_impl(), i.e., the end of the root CMake configuration file of the (sub-)project.

Parameters:
[in]TARGET_UIDName/UID of custom target added by basis_add_script().
See also:
basis_add_script()
Returns:
Nothing.
function basis_build_script_library ( in  TARGET_UID)

Add custom command for build of script library.

This function is called by basis_finalize_targets() which in turn is called at the end of basis_project_impl(), i.e., the end of the root CMake configuration file of the (sub-)project.

Parameters:
[in]TARGET_UIDName/UID of custom target added by basis_add_script_library().
See also:
basis_add_script_library()
Returns:
Nothing.
function 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.
macro basis_compare_lists ( out  RESULT,
in  LIST1,
in  LIST2 
)

Compare two lists.

Parameters:
[out]RESULTResult of comparison.
[in]LIST1Name of variable holding the first list.
[in]LIST2Name of varaible holding the second list.
Return values:
0The two lists are not identical.
1Both lists have identical elements (not necessarily in the same order).
Returns:
Nothing.
macro basis_compile_python_modules_for_jython ( out  FLAG)

Whether to compile Python modules for Jython interpreter.

This macro returns a boolean value stating whether Python modules shall also be compiled for use by Jython interpreter if BASIS_COMPILE_SCRIPTS is ON.

Parameters:
[out]FLAGSet to either TRUE or FALSE depending on whether Python modules shall be compiled using Jython or not.
Returns:
Nothing.
function basis_configure_public_headers ( )

Configure public header files.

Returns:
Nothing.
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.

Returns:
Nothing.
function basis_configure_script ( in  INPUT,
in  OUTPUT,
in  ARGN 
)

Configure and optionally compile script file.

This function is used to configure script files during the build. It is called by the build script generated by basis_add_script_target() for each script target. It is further used to configure the modules of the packages implemented in supported scripting languages which are located in the PROJECT_LIBRARY_DIR of the source tree.

In case of executable scripts, this function automatically prepends the module search paths such that the modules of this software package are found (and preferred in case of potential name conflicts with other packages). Moreover, it adds (or replaces) the shebang directive on Unix such that the configured interpreter version is used. On Windows, it converts the executable script into a Windows Command instead which executes the proper interpreter with the code section of the input script.

Parameters:
[in]INPUTInput script file.
[in]OUTPUTConfigured output script file.
[in]ARGNOptional arguments:
COMPILE Whether to compile module scripts if suitable, i.e., an intermediate format exists for the specific scripting language. For example, Python modules can be compiled.
COPYONLY Whether to only copy the script file without replacing CMake variables within the file. This option is passed on to CMake's configure_file() command used to configure the script file. By default, the option @ONLY is used instead.
EXECUTABLE Specifies that the given script file is an executable script and not a module script. Otherwise, if this option is not given and the output file name contains a file name extension, the given script file is configured as module script. A script file with an output file name that has no extension, is always considered to be an executable.
DESTINATION dir Installation directory for configured script. If this option is given, the BUILD_INSTALL_SCRIPT variable is set to TRUE before including any specified script configuration files (see CONFIG_FILE option). Moreover, the __DIR__ variable is set to the specified directory. Otherwise, if this option is omitted, the BUILD_INSTALL_SCRIPT variable is set to FALSE instead and __DIR__ is set to the directory of the configured OUTPUT file. Note that the BUILD_INSTALL_SCRIPT and __DIR__ variables are in particular used by basis_set_script_path() to convert the given paths to paths relative to the location of the configured/installed script.
CACHE_FILE file1 [file2...] List of CMake files with dump of variables which should be included before configuring the script. The cache files can be generated using the basis_dump_variables() function.
CONFIG_FILE file1 [file2...] List of script configuration files to include before the configuration of the script. See also the documentation of the DESTINATION option.
LINK_DEPENDS dep1 [dep2...] List of "link" dependencies, i.e., modules and script/module libraries required by this script. For executable scripts, the paths to these modules/packages is added to the module search path. If the prefix "relative " is given before a file path, it is made relative to the output/installation directory of the script file. All given input paths must be absolute, however, as the relative location depends on whether the script will be installed, i.e., the DESTINATION is specified, or not.
Returns:
Nothing.
function basis_configure_script_libraries ( )

Add library targets for the public modules in PROJECT_LIBRARY_DIR.

This function configures ("builds") the library modules in the PROJECT_LIBRARY_DIR that are written in a scripting language such as Python or Perl. The names of the added library targets can be modified using the <LANG>_LIBRARY_TARGET variables, which are set to their default values in the BasisSettings.cmake file.

Returns:
Nothing.
function basis_configure_sources ( out  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_configure_utilities ( )

Configure BASIS utilities.

This function configures the following source files which can be used within the source code of the project.

basis.h Header file declaring the BASIS utilities for C++.
basis.cxx Definitions of the constants and functions declared in basis.h.
basis.py Module defining the BASIS utilities for Python.
Basis.pm Module defining the BASIS utilities for Perl.
basis.sh Module defining the BASIS utilities for Bash.
Note:
Dummy versions of the C++ source files have been written by the function basis_configure_auxiliary_sources() beforehand. This is necessary because CMake's add_executable() and add_library() commands raise an error if any of the specified source files does not exist.
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_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.

Returns:
Nothing.
function basis_dump_variables ( in  RESULT_FILE)

Output current CMake variables to file.

Returns:
Nothing.
macro basis_exists_target ( out  RESULT_VARIABLE,
in  TARGET_NAME 
)

Whether a given target exists.

This function should be used instead of the if(TARGET) command of CMake because target names are mapped by BASIS to target UIDs.

Parameters:
[out]RESULT_VARIABLEBoolean result variable.
[in]TARGET_NAMEName which to check whether it is a target.
See also:
basis_make_target_uid()
basis_get_target_uid()
Returns:
Nothing.
function basis_export_build_properties ( in  CODE)

Add code to set properties of imported targets for build tree.

Returns:
Nothing.
function basis_export_footer ( in  CODE)

Add footer of exports file.

Returns:
Nothing.
function basis_export_header ( in  CODE)

Generate header of exports file.

Returns:
Nothing.
function basis_export_import_targets ( in  CODE)

Add code to add import targets.

Returns:
Nothing.
function basis_export_install_properties ( in  CODE)

Add code to set properties of imported targets for installation.

Returns:
Nothing.
function basis_export_prefix ( in  CODE)

Add code to compute prefix relative to INSTALL_CONFIG_DIR.

Returns:
Nothing.
function basis_export_targets ( )

Export all targets added by basis_add_* commands.

Returns:
Nothing.
function basis_finalize_targets ( )

Finalize custom targets by adding the missing build commands.

This function is called by basis_project_impl() in order to finalize the addition of the custom build targets such as, for example, build targets for the build of executable scripts, Python packages, MATLAB Compiler executables and shared libraries, and MEX-files.

Returns:
Generates the CMake build scripts and adds custom build commands and corresponding targets for the execution of these scripts.
See also:
basis_build_script()
basis_build_script_library()
basis_build_mcc_target()
basis_build_mex_file()
macro basis_find_packages ( )

Find packages this project depends on.

Returns:
Nothing.
function basis_get_bash_version ( out  ARGV1)

Get version of Bash interpreter.

Parameters:
[out]ARGV1If given, the named variable is set to the version string of the Bash interpreter. Otherwise, the variables BASH_VERSION_STRING, BASH_VERSION_MAJOR, BASH_VERSION_MINOR, and BASH_VERSION_PATCH are set in the scope of the caller.
Returns:
Nothing.
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_RELEASE 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.

Returns:
Nothing.
function basis_get_compiled_file ( out  CFILE,
in  SOURCE,
in  ARGV2 
)

Get file name of compiled script.

Parameters:
[out]CFILEFile path of compiled script file.
[in]SOURCEScript source file.
[in]ARGV2Language of script file. If not specified, the language is derived from the file name extension and shebang of the script source file.
Returns:
Nothing.
macro basis_get_compiled_jython_file_of_python_module ( out  CFILE,
in  MODULE 
)

Get file path of Jython file compiled from the given Python module.

Python modules are also compiled using Jython. This macro returns the file path of the compiled Jython file in the build tree which corresponds to the specified Python module.

Parameters:
[out]CFILEPath of corresponding compiled Jython file.
[in]MODULEPath of input Python module in build tree.
Returns:
Nothing.
function basis_get_full_matlab_version ( out  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 ( out  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()
Returns:
Nothing.
function basis_get_fully_qualified_test_uid ( out  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()
Returns:
Nothing.
function basis_get_jython_version ( out  ARGV1)

Get version of Jython interpreter.

Parameters:
[out]ARGV1If given, the named variable is set to the version string of the Jython interpreter. Otherwise, the variables JYTHON_VERSION_STRING, JYTHON_VERSION_MAJOR, JYTHON_VERSION_MINOR, and JYTHON_VERSION_PATCH are set in the scope of the caller.
Returns:
Nothing.
function basis_get_matlab_release ( out  ARGV1)

Get release version of MATLAB installation.

Parameters:
[out]ARGV1If given, the named variable is set to the release string of the MATLAB installation, e.g., "R2009b". Otherwise, the variable MATLAB_RELEASE is set in the scope of the caller.
Returns:
Nothing.
function basis_get_matlab_version ( out  ARGV1)

Get version of MATLAB installation.

Parameters:
[out]ARGV1If given, the named variable is set to the version string ("<major>.<minor>.<patch>") of the MATLAB installation. Otherwise, the variables MATLAB_VERSION_STRING, MATLAB_VERSION_MAJOR, MATLAB_VERSION_MINOR, MATLAB_VERSION_PATCH, and MATLAB_RELEASE are set in the scope of the caller.
Returns:
Nothing.
function basis_get_perl_version ( out  ARGV1)

Get version of Perl interpreter.

Parameters:
[out]ARGV1If given, the named variable is set to the version string of the Perl interpreter. Otherwise, the variables PERL_VERSION_STRING, PERL_VERSION_MAJOR, PERL_VERSION_MINOR, and PERL_VERSION_PATCH are set in the scope of the caller.
Returns:
Nothing.
function basis_get_project_property ( out  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.
Returns:
Nothing.
function basis_get_python_version ( out  ARGV1)

Get version of Python interpreter.

Parameters:
[out]ARGV1If given, the named variable is set to the version string of the Python interpreter. Otherwise, the variables PYTHON_VERSION_STRING, PYTHON_VERSION_MAJOR, PYTHON_VERSION_MINOR, and PYTHON_VERSION_PATCH are set in the scope of the caller.
Returns:
Nothing.
function basis_get_soname ( out  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.
Returns:
Nothing.
function basis_get_source_language ( out  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, MATLAB, PYTHON, JYTHON, PERL, BASH, BATCH.

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

Derive target name from source file name.

Parameters:
[out]TARGET_NAMETarget name.
[in]SOURCE_FILESource file.
[in]ARGNThird argument to get_filename_component(). If not specified, the given path is only sanitized.
Returns:
Target name derived from SOURCE_FILE.
function basis_get_target_link_libraries ( out  LINK_DEPENDS,
in  TARGET_NAME 
)

Get link libraries/dependencies of (imported) target.

This function recursively adds the dependencies of the dependencies as well and returns them together with the list of the direct link dependencies. Moreover, for script targets, if any of the dependencies uses the BASIS utilities for the given language (BASIS_UTILITIES property), the corresponding utilities library is added to the list of dependencies. Note that therefore the BASIS utilities targets have to be added already, which is only the case during the finalization of script targets.

Parameters:
[out]LINK_DEPENDSList of all link dependencies. In case of scripts, the dependencies are the required modules or paths to required packages, respectively.
[in]TARGET_NAMEName of the target.
Returns:
Nothing.
function basis_get_target_location ( out  VAR,
in  TARGET_NAME,
in  PART 
)

Get location of build target output file(s).

This convenience function can be used to get the full path of the output file(s) 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. In case of scripted libraries, this function returns the path of the root directory of the library that has to be added to the module search path.

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 ( out  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 ( out  TARGET_NS,
in  TARGET_UID 
)

Get namespace of build target.

Parameters:
[out]TARGET_NSNamespace part of target UID.
[in]TARGET_UIDTarget UID/name.
Returns:
Nothing.
function basis_get_target_type ( out  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.
Returns:
Nothing.
function basis_get_target_uid ( out  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.

The individual parts of the target UID, i.e, package name, module name, and target name are separated by a dot (.). If BASIS_USE_FULLY_QUALIFIED_UIDS is set to OFF, the common part of all target UIDs is removed by this function from the target UID. When the target is exported, however, this common part 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 and makes things unnecessarily complicated.
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 ( out  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 ( out  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.
Returns:
Nothing.
function basis_get_test_uid ( out  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 actual 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()
macro basis_initialize_settings ( )

Initialize project settings.

Returns:
Nothing.
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_install_public_headers ( )

Add installation rules for public header files.

Returns:
Nothing.
function 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.
macro basis_is_cached ( out  VAR,
in  ENTRY 
)

Determine if cache entry exists.

Parameters:
[out]VARName of boolean result variable.
[in]ENTRYName of cache entry.
Returns:
Nothing.
macro basis_library_prefix ( out  PREFIX,
in  LANGUAGE 
)

Get default subdirectory prefix of scripted library modules.

Parameters:
[out]PREFIXName of variable which is set to the default library prefix, i.e., subdirectory relative to the library root directory as used for the PREFIX property of scripted module libraries (see basis_add_script_library()) or relative to the include directory in case of C++. Note that this prefix includes a trailing slash to indicate that the prefix is a subdirectory.
[in]LANGUAGEProgramming language (case-insenitive), e.g., CXX, Python, Matlab...
Returns:
Nothing.
function basis_list_to_delimited_string ( out  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. If this list starts with the argument NOAUTOQUOTE, the automatic quoting of list elements which contain the delimiter is disabled.
Returns:
Sets STR to the resulting string.
macro basis_list_to_regex ( out  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 "[^ ]+".
Returns:
Nothing.
function basis_list_to_string ( out  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 ( out  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 ( out  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 ( out  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.
macro basis_module_check ( in  MODULE,
in  NEEDED_BY,
in  STACK 
)
Returns:
Nothing.
macro basis_module_enable ( in  MODULE,
in  NEEDED_BY 
)
Returns:
Nothing.
function basis_normalize_name ( out  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.
Returns:
Nothing.
function basis_process_generator_expressions ( out  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 CMAKE_INSTALL_PREFIX.
$<TARGET_FILE_POST_INSTALL_RELATIVE:tgt> Path of target file after installation relative to CMAKE_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
Returns:
Nothing.
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_REVISIONRevision number of Subversion controlled source tree or 0 if the source tree is not under revision control.
PROJECT_RELEASEA 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:
  • "v1.0 (r42)"
  • "v1.0.5 (r50)"
  • "v1.0" (if revision unknown)
  • "r42" (if version is 0.0.0)
  • "" (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.
Returns:
Nothing.
function basis_register_package ( )

Register installed package with CMake.

This function adds an entry to the CMake registry for packages with the path of the directory where the package configuration file is located in order to help CMake find the package.

The uninstaller whose template can be found in cmake_uninstaller.cmake.in is responsible for removing the registry entry again.

Returns:
Nothing.
macro basis_sanitize_for_regex ( out  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.
Returns:
Nothing.
macro basis_set_flag ( in  PREFIX,
out  FLAG,
in  DEFAULT 
)

Set flag given mutually exclusive ARGN_<FLAG> and ARGN_NO<FLAG> function arguments.

Parameters:
[in]PREFIXPrefix of function arguments. Set to the first argument of the CMAKE_PARSE_ARGUMENTS() command.
[out]FLAGName of flag.
[in]DEFAULTDefault flag value if neither ARGN_<FLAG;gt; nor ARGN_NO<FLAG;gt; evaluates to true.
Returns:
Nothing.
macro basis_set_if_empty ( out  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 ( out  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.
macro basis_set_or_update_type ( in  VAR,
in  TYPE,
in  ARGN 
)

Set type of variable.

If the variable is cached, the type is updated, otherwise, a cache entry of the given type with the current value of the variable is added.

Parameters:
[in]VARName of variable.
[in]TYPEDesired type of variable.
[in]ARGNOptional DOC string used if variable was not cached before.
Returns:
Nothing.
macro basis_set_or_update_value ( in  VAR)

Set variable value.

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).

Returns:
Nothing.
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.

Returns:
Nothing.
function basis_set_target_install_rpath ( in  TARGET_NAME)

Set INSTALL_RPATH property of executable or shared library target.

This function sets the INSTALL_RPATH property of a specified executable or shared library target using the LINK_DEPENDS obtained using the basis_get_target_link_libraries() function. It determines the installation location of each dependency using the basis_get_target_location() function.

Returns:
Sets the INSTALL_RPATH property of the specified target.
See also:
basis_get_target_link_libraries()
macro basis_slicer_module_initialize ( )

Initialize slicer module meta-data.

At the moment, only one module, most often the top-level project can be a Slicer module, i.e., call basis_slicer_module() either in the BasisProject.cmake file of the top-level project or in the corresponding file of at most one of the project modules.

Returns:
Nothing.
function basis_slicer_module_to_extension_metadata ( )

Copy MODULE_* metadata to EXTENSION_* metadata of Slicer Extension.

This function is required to work-around bug 1901 in Slicer 4.1.0. It basically implements what the SlicerBlockModuleToExtensionMetadata.cmake module which can be found in the Extensions/CMake/ directory of the Slicer 4 source tree is implementing. The list of metadata has been copied from this particular CMake module of the 4.1.0 release of Slicer.

See also:
http://www.na-mic.org/Bug/view.php?id=1901
Returns:
Nothing.
function basis_string_to_list ( out  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,
out  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,
out  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,
out  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_tokenize_dependency ( in  DEP,
out  PKG,
out  VER,
out  CMP 
)

Tokenize dependency specification.

This function parses a dependency specification such as "ITK-4.1{TestKernel,IO}" into the package name, i.e., ITK, the requested (minimum) package version, i.e., 4.1, and a list of package components, i.e., TestKernel and IO. A valid dependency specification must specify the package name of the dependency (case-sensitive). The version and components specification are optional. Note that the components specification may be separated by an arbitrary number of whitespace characters including newlines. The same applies to the specification of the components themselves. This allows one to format the dependency specification as follows, for example:

 ITK {
   TestKernel,
   IO
 }
Parameters:
[in]DEPDependency specification, i.e., "<Pkg>[-<version>][{<Component1>[,...]}]".
[out]PKGPackage name.
[out]VERPackage version.
[out]CMPList of package components.
Returns:
Nothing.
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.
Returns:
Nothing.
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.
Returns:
Nothing.
macro basis_update_type_of_variable ( in  VAR,
in  TYPE 
)

Change type of cached variable.

If the variable is not cached, nothing is done.

Returns:
Nothing.
macro basis_update_value ( in  VAR)

Update cache variable.

Returns:
Nothing.
function basis_utilities_check ( out  VAR,
in  SOURCE_FILE,
in  ARGN 
)

Check whether the BASIS utilities are used within a given source file.

This function matches the source code against specific import patterns which are all valid imports of the BASIS utilities for the respective programming language of the specified file. If the BASIS utilities are used within the specified source file, the variable named VAR is set to TRUE. Otherwise, it is set to FALSE.

Parameters:
[out]VARWhether the BASIS utilites are used.
[in]SOURCE_FILEPath of source file to check.
[in]ARGNSource code language. If not specified, the programming language is determined automatically.
Returns:
Nothing.
function basis_version_numbers ( in  VERSION,
out  MAJOR,
out  MINOR,
out  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.
macro basis_write_addpaths_mfile ( in  MFILE,
in  ARGN 
)

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

Parameters:
[in]MFILEName of M-file.
[in]ARGNThe remaining arguments are the paths which should be added to the search path of MATLAB when this M-file is being executed. If the option APPEND is given, the paths are appended to the specified M-file. Otherwise, any existing file will be overwritten. The given directory paths can be relative, in which case they are interpreted relative to the location of the written M-file using the mfilename() function of MATLAB.
Returns:
Nothing.
function basis_write_list ( in  FILENAME,
in  VARIABLE 
)

Write CMake script file which sets the named variable to the specified (list of) values.

Returns:
Nothing.
macro find_package ( )

Overloaded find_package() command.

This macro calls CMake's find_package() command and converts obsolete all uppercase "<PKG>_<VAR>" variables to case-sensitive "<Pkg>_<VAR>" variables. It further ensures that the global variables CMAKE_FIND_LIBRARY_SUFFIXES and CMAKE_FIND_EXECUTABLE_SUFFIX are reset to the values they had before the call to find_package(). This is required if the "Find<Pkg>.cmake" module has modified these variables, but not restored their initial value.

Returns:
Nothing.
function get_filename_component ( inout  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
Returns:
Nothing.

Variable Documentation

option BUILD_ALL_MODULES = OFF

Definition at line 488 of file ProjectTools.cmake.

cmake CONFIG_FILE

Name of the CMake package configuration file.

Definition at line 41 of file GenerateConfig.cmake.

Package name.

Definition at line 39 of file GenerateConfig.cmake.

Name of the CMake target exports file for custom targets.

Definition at line 49 of file GenerateConfig.cmake.

cmake EXPORTS_FILE

Name of the CMake target exports file.

Definition at line 47 of file GenerateConfig.cmake.

Definition at line 527 of file ProjectTools.cmake.

Definition at line 526 of file ProjectTools.cmake.

cmake USE_FILE

Name of the CMake package use file.

Definition at line 45 of file GenerateConfig.cmake.

cmake VERSION_FILE

Name of the CMake package version file.

Definition at line 43 of file GenerateConfig.cmake.