File indexing completed on 2024-05-12 04:44:36
0001 // SPDX-FileCopyrightText: Lukas Sommer <sommerluk@gmail.com> 0002 // SPDX-License-Identifier: BSD-2-Clause OR MIT 0003 0004 #ifndef VERSION_H 0005 #define VERSION_H 0006 0007 #include "importexport.h" 0008 0009 #include <qglobal.h> 0010 #include <qversionnumber.h> 0011 0012 /** @file 0013 * 0014 * This file provides version information for this library at compile 0015 * time and at run time. 0016 * 0017 * @note Do not include this file itself! Instead, include <tt>version.h</tt>. 0018 * 0019 * @internal 0020 * 0021 * @note This file is configuration input: CMake processes it, 0022 * puts the actual version numbers (<tt>\@…\@</tt>) and saves the result 0023 * as <tt>version.h</tt>. 0024 * 0025 * @note This file has the extension .hpp because we want a different 0026 * extension for configuration input than for headers. This allows to 0027 * <em>not</em> process this file by clang-format. (clang-format does not 0028 * understand the CMake configuration syntax with <tt>\@…\@</tt> and would 0029 * break it.) */ 0030 0031 /** @def PERCEPTUALCOLOR_COMPILE_TIME_VERSION_MAJOR 0032 * 0033 * @returns The <em>major</em> version (as integer) of this library 0034 * against which you are compiling. You can use this macro to use the 0035 * latest features where available. 0036 * 0037 * To use this macro, include <tt>version.h</tt> 0038 * 0039 * @sa @ref versioninfo */ 0040 #define PERCEPTUALCOLOR_COMPILE_TIME_VERSION_MAJOR (@MAJOR_VERSION@) 0041 0042 /** @def PERCEPTUALCOLOR_COMPILE_TIME_VERSION_MINOR 0043 * 0044 * @returns The <em>minor</em> version (as integer) of this library 0045 * against which you are compiling. You can use this macro to use the 0046 * latest features where available. 0047 * 0048 * To use this macro, include <tt>version.h</tt> 0049 * 0050 * @sa @ref versioninfo */ 0051 #define PERCEPTUALCOLOR_COMPILE_TIME_VERSION_MINOR (@MINOR_VERSION@) 0052 0053 /** @def PERCEPTUALCOLOR_COMPILE_TIME_VERSION_PATCH 0054 * 0055 * @returns The <em>patch</em> version (as integer) of this library 0056 * against which you are compiling. You can use this macro to use the 0057 * latest features where available. 0058 * 0059 * To use this macro, include <tt>version.h</tt> 0060 * 0061 * @sa @ref versioninfo */ 0062 #define PERCEPTUALCOLOR_COMPILE_TIME_VERSION_PATCH (@PATCH_VERSION@) 0063 0064 /** @def PERCEPTUALCOLOR_COMPILE_TIME_VERSION 0065 * 0066 * @brief Against which version of this library you are <em>compiling</em>. 0067 * 0068 * This macro has the same semantic as <tt>QT_VERSION</tt> 0069 * 0070 * @returns This macro expands a numeric value of the form 0xMMNNPP 0071 * (MM = major, NN = minor, PP = patch) that specifies the version number. 0072 * Note that there is no pre-release identifier included. For example, if 0073 * you compile your application against version 1.2.3-alpha of this library, 0074 * the macro will expand to 0x010203. You can use this macro to use the 0075 * latest features where available. Example: 0076 * 0077 * @snippet testversion.cpp Version Macro usage 0078 * 0079 * To use this macro, include <tt>version.h</tt> 0080 * 0081 * @sa @ref versioninfo */ 0082 #define PERCEPTUALCOLOR_COMPILE_TIME_VERSION (QT_VERSION_CHECK(PERCEPTUALCOLOR_COMPILE_TIME_VERSION_MAJOR, PERCEPTUALCOLOR_COMPILE_TIME_VERSION_MINOR, PERCEPTUALCOLOR_COMPILE_TIME_VERSION_PATCH)) 0083 0084 namespace PerceptualColor 0085 { 0086 [[nodiscard]] PERCEPTUALCOLOR_IMPORTEXPORT QVersionNumber perceptualColorRunTimeVersion(); 0087 0088 } // namespace PerceptualColor 0089 0090 #endif // VERSION_H