1##############################################################################
2# @file  BasisScriptConfig.cmake
3# @brief BASIS script configuration.
4#
5# @note The file BasisScriptConfig.cmake is automatically generated by BASIS
6#       from the template file ScriptConfig.cmake.in which is part of BASIS.
7#
8# This script configuration file is included before the default script
9# configuration file which is part of the package itself (ScriptConfig.cmake),
10# if such file exists in the @c PROJECT_CONFIG_DIR.
11# Therefore, the BASIS script configuration can be overwritten by the
12# default script configuration of the project, which in turn can be
13# overwritten specifically for each script target by specifying a
14# script target-specific script configuration using the @c CONFIG and/or
15# @c CONFIG_FILE option of the basis_add_executable() or basis_add_library()
16# command, respectively.
17#
18# @sa https://cmake-basis.github.io/standard/scripttargets.html#script-configuration
19#
20# @ingroup BasisScriptConfig
21##############################################################################
22
23## @addtogroup BasisScriptConfig
24# @{
25
26
27# ============================================================================
28# script attributes
29# ============================================================================
30
31# Note: The following set() commands are required for the API documentation.
32
33## @brief Detected scripting language or UNKNOWN.
34set (LANGUAGE "${LANGUAGE}")
35
36## @brief Directory of script file.
37#
38# @note Mainly used in script configuration itself to make relative paths
39#       absolute. In particular, basis_set_script_path() uses this variable.
40set (__DIR__ "${__DIR__}")
41
42## @brief Absolute path of script file.
43#
44# @note As this path is fixed after the build, it should be used only if
45#       it is not otherwise possible to determine the path of the current
46#       script file. It prohibits the relocation of the installation.
47set (__FILE__ "${__FILE__}")
48
49## @brief Name of script file.
50set (__NAME__ "${__NAME__}")
51
52## @brief Name of script file in uppercase only.
53string (TOUPPER "${__NAME__}" __NAME_U__)
54## @brief Name of script file in lowercase only.
55string (TOLOWER "${__NAME__}" __NAME_L__)
56
57# ============================================================================
58# aliases of script attributes for backward compatibility
59# ============================================================================
60
61set (DIR    ${__DIR__})
62set (FILE   ${__FILE__})
63set (NAME   ${__NAME__})
64set (NAME_U ${__NAME_U__})
65set (NAME_L ${__NAME_L__})
66
67# ============================================================================
68# directories
69# ============================================================================
70
71# ----------------------------------------------------------------------------
72# relative to script file
73
74# Example:
75# @code
76# #! /usr/bin/env bash
77# get_executable_directory exec_dir
78# libexec_dir=${exec_dir}/__LIBEXEC_DIR__
79# @endcode
80
81## @brief Installation prefix relative to script location.
82basis_set_script_path (PREFIX_DIR "@CMAKE_BINARY_DIR@" "@CMAKE_INSTALL_PREFIX@")
83
84## @brief Directory of main executables relative to script location.
85basis_set_script_path (RUNTIME_DIR "@BINARY_RUNTIME_DIR@" "@INSTALL_RUNTIME_DIR@")
86## @brief Directory of auxiliary executables relative to script location.
87basis_set_script_path (LIBEXEC_DIR "@BINARY_LIBEXEC_DIR@" "@INSTALL_LIBEXEC_DIR@")
88## @brief Directory of shared and module libraries relative to script location.
89basis_set_script_path (LIBRARY_DIR "@BINARY_LIBRARY_DIR@" "@INSTALL_LIBRARY_DIR@")
90## @brief Directory of static and import libraries relative to script location.
91basis_set_script_path (ARCHIVE_DIR "@BINARY_ARCHIVE_DIR@" "@INSTALL_ARCHIVE_DIR@")
92## @brief Directory of auxiliary data files relative to script location.
93basis_set_script_path (DATA_DIR "@PROJECT_DATA_DIR@" "@INSTALL_DATA_DIR@")
94
95## @brief Directory of Python modules relative to script location.
96basis_set_script_path (PYTHON_LIBRARY_DIR "@BINARY_PYTHON_LIBRARY_DIR@" "@INSTALL_PYTHON_LIBRARY_DIR@")
97## @brief Directory of Jython modules relative to script location.
98basis_set_script_path (JYTHON_LIBRARY_DIR "@BINARY_JYTHON_LIBRARY_DIR@" "@INSTALL_JYTHON_LIBRARY_DIR@")
99## @brief Directory of Perl modules relative to script location.
100basis_set_script_path (PERL_LIBRARY_DIR "@BINARY_PERL_LIBRARY_DIR@" "@INSTALL_PERL_LIBRARY_DIR@")
101## @brief Directory of MATLAB modules relative to script location.
102basis_set_script_path (MATLAB_LIBRARY_DIR "@BINARY_MATLAB_LIBRARY_DIR@" "@INSTALL_MATLAB_LIBRARY_DIR@")
103## @brief Directory of Bash modules relative to script location.
104basis_set_script_path (BASH_LIBRARY_DIR "@BINARY_BASH_LIBRARY_DIR@" "@INSTALL_BASH_LIBRARY_DIR@")
105
106# ----------------------------------------------------------------------------
107# relative to installation prefix
108
109# Example:
110# @code
111# #! /usr/bin/env bash
112# get_executable_directory exec_dir
113# libexec_dir=${exec_dir}/__PREFIX_DIR__/__LIBEXEC_DIR_SUFFIX__
114# @endcode
115
116basis_get_relative_path (RUNTIME_DIR_SUFFIX        "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${RUNTIME_DIR}")
117basis_get_relative_path (LIBEXEC_DIR_SUFFIX        "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${LIBEXEC_DIR}")
118basis_get_relative_path (LIBRARY_DIR_SUFFIX        "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${LIBRARY_DIR}")
119basis_get_relative_path (ARCHIVE_DIR_SUFFIX        "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${ARCHIVE_DIR}")
120basis_get_relative_path (DATA_DIR_SUFFIX           "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${DATA_DIR}")
121
122basis_get_relative_path (PYTHON_LIBRARY_DIR_SUFFIX "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${PYTHON_LIBRARY_DIR}")
123basis_get_relative_path (JYTHON_LIBRARY_DIR_SUFFIX "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${JYTHON_LIBRARY_DIR}")
124basis_get_relative_path (PERL_LIBRARY_DIR_SUFFIX   "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${PERL_LIBRARY_DIR}")
125basis_get_relative_path (MATLAB_LIBRARY_DIR_SUFFIX "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${MATLAB_LIBRARY_DIR}")
126basis_get_relative_path (BASH_LIBRARY_DIR_SUFFIX   "${__DIR__}/${PREFIX_DIR}" "${__DIR__}/${BASH_LIBRARY_DIR}")
127
128# Note: The following set() commands are needed for the API documentation.
129
130## @brief Directory of main executables relative to installation prefix.
131set (RUNTIME_DIR_SUFFIX "${RUNTIME_DIR_SUFFIX}")
132## @brief Directory of auxiliary executables relative to installation prefix.
133set (LIBEXEC_DIR_SUFFIX "${LIBEXEC_DIR_SUFFIX}")
134## @brief Directory of shared and module libraries relative to installation prefix.
135set (LIBRARY_DIR_SUFFIX "${LIBRARY_DIR_SUFFIX}")
136## @brief Directory of static and import libraries relative to installation prefix.
137set (ARCHIVE_DIR_SUFFIX "${ARCHIVE_DIR_SUFFIX}")
138## @brief Directory of auxiliary data files relative to installation prefix.
139set (DATA_DIR_SUFFIX "${DATA_DIR_SUFFIX}")
140
141## @brief Directory of Python modules relative to installation prefix.
142set (PYTHON_LIBRARY_DIR_SUFFIX "${PYTHON_LIBRARY_DIR_SUFFIX}")
143## @brief Directory of Jython modules relative to installation prefix.
144set (JYTHON_LIBRARY_DIR_SUFFIX "${JYTHON_LIBRARY_DIR_SUFFIX}")
145## @brief Directory of Perl modules relative to installation prefix.
146set (PERL_LIBRARY_DIR_SUFFIX "${PERL_LIBRARY_DIR_SUFFIX}")
147## @brief Directory of MATLAB modules relative to installation prefix.
148set (MATLAB_LIBRARY_DIR_SUFFIX "${MATLAB_LIBRARY_DIR_SUFFIX}")
149## @brief Directory of Bash modules relative to installation prefix.
150set (BASH_LIBRARY_DIR_SUFFIX "${BASH_LIBRARY_DIR_SUFFIX}")
151
152
153## @}
154# end of Doxygen group
155