BASIS  version 1.2.3 (revision 2104)
config.h
Go to the documentation of this file.
00001 /**
00002  * @file  config.h
00003  * @brief Default include file with project configuration.
00004  *
00005  * @note The config.h file is automatically generated by BASIS from the
00006  *       file config.h.in which is part of BASIS.
00007  *
00008  * Copyright (c) 2011 University of Pennsylvania. All rights reserved.<br />
00009  * See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
00010  *
00011  * Contact: SBIA Group <sbia-software at uphs.upenn.edu>
00012  */
00013 
00014 #pragma once
00015 #ifndef _SBIA_BASIS_CONFIG_H
00016 #define _SBIA_BASIS_CONFIG_H
00017 
00018 
00019 /// @addtogroup BasisCxxUtilities
00020 /// @{
00021 
00022 
00023 // ===========================================================================
00024 // system
00025 // ===========================================================================
00026 
00027 /// @def   LINUX
00028 /// @brief Whether the sources are compiled on a Linux system.
00029 #ifndef LINUX
00030 #  define LINUX (defined (linux) || defined (__linux))
00031 #endif
00032 
00033 /// @def   WINDOWS
00034 /// @brief Whether the sources are compiled on a Windows system.
00035 #ifndef WINDOWS
00036 #  define WINDOWS (defined (_WIN32) || defined (WIN32) || defined (_WINDOWS))
00037 #endif
00038 
00039 /// @def   MACOS
00040 /// @brief Whether the sources are compiled on a Mac OS system.
00041 #ifndef MACOS
00042 #  define MACOS (defined (__APPLE__) || defined (__OSX__))
00043 #endif
00044 
00045 /// @def   UNIX
00046 /// @brief Whether the sources are compiled on a Unix-based system.
00047 #ifndef UNIX
00048 #  define UNIX (!WINDOWS)
00049 #endif
00050 
00051 /// @def   HAVE_LONG_LONG
00052 /// @brief Whether the long long type is supported by the compiler.
00053 #ifndef HAVE_LONG_LONG
00054 #  define HAVE_LONG_LONG 1
00055 #endif
00056 
00057 /// @def HAVE_SSTREAM
00058 /// @brief Whether the ANSI string stream classes are available.
00059 #ifndef HAVE_SSTREAM
00060 #  define HAVE_SSTREAM 1
00061 #endif
00062 
00063 /**
00064  * @def   HAVE_STRSTREAM
00065  * @brief Whether the obsolete string stream classes are available.
00066  *
00067  * @note As the strstream implementations are obsolete already for a long
00068  *       time, this macro always evaluates to 0.
00069  */
00070 #ifdef HAVE_STRSTREAM
00071 #  undef HAVE_STRSTREAM
00072 #endif
00073 #define HAVE_STRSTREAM 0
00074 
00075 /// @def HAVE_PTHREAD
00076 /// @brief Whether the pthread library is available.
00077 #ifndef HAVE_PTHREAD
00078 #  define HAVE_PTHREAD 1
00079 #endif
00080 
00081 /**
00082  * @def HAVE_TR1_TUPLE
00083  * @brief Whether the tr1/tuple header file is available.
00084  *
00085  * @note This header file is only more recently supported by compilers
00086  *       and be used by Google Test, for example. If not supported by
00087  *       the compiler, Google Test can use it's own implementation.
00088  */
00089 #ifndef HAVE_TR1_TUPLE
00090 #  define HAVE_TR1_TUPLE 1
00091 #endif
00092 
00093 // ===========================================================================
00094 // namespace
00095 // ===========================================================================
00096 
00097 /**
00098  * @brief Full project own namespace identifier.
00099  *
00100  * This macro should preferably be used when referring to the project own
00101  * namespace. The namespace can then be renamed later on without affecting
00102  * written source code.
00103  *
00104  * @note Namespace identifier may reflect a nested namespace.
00105  */
00106 #define SBIA_BASIS_NAMESPACE \
00107     ::sbia::basis
00108 
00109 /**
00110  * @brief Macro used to enter project own namespace.
00111  *
00112  * Example: 
00113  * @code
00114  * SBIA_BASIS_NAMESPACE_BEGIN
00115  *
00116  * // project source code within project own namespace
00117  *
00118  * SBIA_BASIS_NAMESPACE_END
00119  * @endcode 
00120  */ 
00121 #define SBIA_BASIS_NAMESPACE_BEGIN \
00122     namespace sbia { namespace basis {
00123 
00124 /**
00125  * @brief Macro used to exit project own namespace.
00126  *
00127  * Example: 
00128  * @code
00129  * SBIA_BASIS_NAMESPACE_BEGIN
00130  *
00131  * // project source code within project own namespace
00132  *
00133  * SBIA_BASIS_NAMESPACE_END
00134  * @endcode 
00135  */
00136 #define SBIA_BASIS_NAMESPACE_END } }
00137 
00138 // ===========================================================================
00139 // constants
00140 // ===========================================================================
00141 
00142 namespace sbia
00143 {
00144 
00145 namespace basis
00146 {
00147 
00148 
00149 // ---------------------------------------------------------------------------
00150 // project attributes
00151 
00152 /// @brief The project name.
00153 extern const char* cProjectName;
00154 
00155 /// @brief The project name in lowercase only.
00156 extern const char* cProjectNameLower;
00157 
00158 /// @brief The project name in uppercase only.
00159 extern const char* cProjectNameUpper;
00160 
00161 /// @brief The major version number.
00162 extern const unsigned int cVersionMajor;
00163 
00164 /// @brief The minor version number.
00165 extern const unsigned int cVersionMinor;
00166 
00167 /// @brief The patch number.
00168 extern const unsigned int cVersionPatch;
00169 
00170 /// @brief The version string given as "<major>.<minor>.<patch>".
00171 extern const char* cVersion;
00172 
00173 /**
00174  * @brief The Subversion revision number of the project.
00175  *
00176  * Note that the revision number is not known when the software is built
00177  * from a source distribution package instead of a Subversion working copy.
00178  * In this case, the revision number is set to 0, an invalid revision number.
00179  * Therefore, the revision number should only be used within the version
00180  * information of executables, but not for conditional execution.
00181  */
00182 extern const unsigned int cRevision;
00183 
00184 /// @brief Complete version information as output by --version option.
00185 extern const char* cVersionAndRevision;
00186 
00187 // ---------------------------------------------------------------------------
00188 // paths - build tree
00189 
00190 /**
00191  * @brief Absolute path of top directory of build tree.
00192  *
00193  * This constant is set to the absolute path of the top directory of the build
00194  * tree in which the software was built. It can be used to determine whether
00195  * an executable is executing from within the build tree rather than an
00196  * installation. Given that we tend to build software in a directory with the
00197  * prefix "-build", but never choose such directory for the installation prefix,
00198  * a check whether or not the location of the executable file is inside this
00199  * build tree is enough to know whether or not it is executed from within the
00200  * build tree or an installation.
00201  *
00202  * @sa get_installation_directory()
00203  */
00204 extern const char* cBuildRoot;
00205 
00206 /**
00207  * @brief Absolute path to runtime executables in build tree.
00208  *
00209  * @sa get_runtime_directory()
00210  */
00211 extern const char* cRuntimeBuildPath;
00212 
00213 /**
00214  * @brief Absolute path to auxiliary executables in build tree.
00215  *
00216  * @sa get_libexec_directory()
00217  */
00218 extern const char* cLibexecBuildPath;
00219 
00220 /**
00221  * @brief Absolute path to modules and shared libraries in build tree.
00222  *
00223  * @sa get_library_directory()
00224  */
00225 extern const char* cLibraryBuildPath;
00226 
00227 /**
00228  * @brief Absolute path to auxiliary data files in build tree.
00229  *
00230  * @sa get_data_directory()
00231  */
00232 extern const char* cDataBuildPath;
00233 
00234 // ---------------------------------------------------------------------------
00235 // paths - installation
00236 
00237 /**
00238  * @brief Path prefix used by runtime executables.
00239  *
00240  * This path prefix is used by runtime executables as prefix for any of the
00241  * relative path constants defined globally.
00242  *
00243  * Example:
00244  * @code
00245  * std::string path = get_executable_directory() + cRuntimePathPrefix + cDataPath;
00246  * @endcode
00247  *
00248  * The resulting path is the absolute path to the shared data directory if
00249  * executed by a main executable which is located in the runtime directory.
00250  *
00251  * @sa get_installation_directory()
00252  */
00253 extern const char* cRuntimePathPrefix;
00254 
00255 /**
00256  * @brief Path prefix used by auxiliary executables.
00257  *
00258  * This path prefix is used by auxiliary executables as prefix for any of the
00259  * relative path constants defined globally.
00260  *
00261  * Example:
00262  * @code
00263  * std::string path = get_executable_directory() + cLibexecPathPrefix + cDataPath;
00264  * @endcode
00265  *
00266  * The resulting path is the absolute path to the shared data directory if
00267  * executed by an auxiliary executable which is located in the libexec directory.
00268  *
00269  * @sa get_installation_directory()
00270  */
00271 extern const char* cLibexecPathPrefix;
00272 
00273 /**
00274  * @brief Path to runtime executables relative to executable directory.
00275  *
00276  * @sa cRuntimePathPrefix
00277  * @sa cLibexecPathPrefix
00278  *
00279  * @sa get_runtime_directory()
00280  */
00281 extern const char* cRuntimePath;
00282 
00283 /**
00284  * @brief Path to auxiliary executables relative to executable directory.
00285  *
00286  * @sa cRuntimePathPrefix
00287  * @sa cLibexecPathPrefix
00288  *
00289  * @sa get_libexec_directory()
00290  */
00291 extern const char* cLibexecPath;
00292 
00293 /**
00294  * @brief Path to modules and shared libraries relative to executable directory.
00295  *
00296  * @sa cRuntimePathPrefix
00297  * @sa cLibexecPathPrefix
00298  *
00299  * @sa get_library_directory()
00300  */
00301 extern const char* cLibraryPath;
00302 
00303 /**
00304  * @brief Path to shared data relative to executable path prefix.
00305  *
00306  * @sa cRuntimePathPrefix
00307  * @sa cLibexecPathPrefix
00308  *
00309  * @sa get_data_directory()
00310  */
00311 extern const char* cDataPath;
00312 
00313 
00314 } // namespace basis
00315 
00316 } // namespace sbia
00317 
00318 
00319 /// @}
00320 // end of Doxygen group
00321 
00322 #endif // _SBIA_BASIS_CONFIG_H
00323