Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d978a044e | |||
| 2b80fbc79c | |||
| f8c0dbd2e3 | |||
| baa4499634 | |||
| d163a141e0 | |||
| ad06e9cc75 | |||
| 8061b75697 | |||
| 08392721a9 | |||
| ccd1afb22a | |||
| 2b0699284a | |||
| 9fe3d44d54 | |||
| 208fb31040 | |||
| c61e2cb2ce | |||
| e4313a31ad | |||
| f3d5d3956c | |||
| 519fe4cc75 | |||
| 50e6f494af |
@@ -0,0 +1,88 @@
|
||||
name: Generate Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
- '!documentation'
|
||||
paths:
|
||||
- '.github/workflows/documentation.yml'
|
||||
- 'docs/**'
|
||||
- 'tools/**'
|
||||
- 'LICENSE'
|
||||
|
||||
jobs:
|
||||
docs:
|
||||
name: "Generate Documentation"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Set up Git"
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global user.name 'GitHub Actions'
|
||||
git config --global user.email 'xaymar@users.noreply.github.com'
|
||||
git config --global pull.ff only
|
||||
git config --global pull.rebase true
|
||||
|
||||
- name: "Clone"
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: 'recursive'
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "Clone Documentation"
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
ref: 'documentation'
|
||||
path: 'build/docs/html'
|
||||
submodules: 'recursive'
|
||||
fetch-depth: 0
|
||||
# git clone --progress --recursive -b documentation --single-branch https://x-access-token:${{ github.token }}@github.com/${{ github.repository }} "${{ github.workspace }}/build/docs/html"
|
||||
|
||||
- name: "Install Prerequisites"
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get install make python3 python3-pip python3-virtualenv
|
||||
|
||||
- name: "Install Sphinx and Themes into a VirtualEnv"
|
||||
shell: bash
|
||||
run: |
|
||||
source ~/.profile
|
||||
virtualenv build/venv
|
||||
source build/venv/bin/activate
|
||||
pip install sphinx
|
||||
pip install sphinx-rtd-theme
|
||||
|
||||
- name: "Generate Documentation"
|
||||
shell: bash
|
||||
run: |
|
||||
source ~/.profile
|
||||
source build/venv/bin/activate
|
||||
pushd tools
|
||||
make html
|
||||
ls -lha
|
||||
popd
|
||||
ls -lha
|
||||
|
||||
- name: "Update Documentation"
|
||||
shell: bash
|
||||
run: |
|
||||
pushd build/docs/html
|
||||
git add .
|
||||
git --no-pager diff --patch --minimal HEAD --
|
||||
git update-index --refresh
|
||||
if ! git diff-index --quiet HEAD --; then
|
||||
git commit -a -m "${{ github.sha }}"
|
||||
|
||||
# Only push from master branch.
|
||||
if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
|
||||
git push
|
||||
echo "Documentation has been updated!"
|
||||
else
|
||||
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
|
||||
fi
|
||||
else
|
||||
echo "Documentation is still up to date."
|
||||
fi
|
||||
popd
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
name: Automated Testing
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
- '!documentation'
|
||||
paths:
|
||||
- '.github/workflows/test.yml'
|
||||
- 'tests/**'
|
||||
- 'version.cmake'
|
||||
pull_request:
|
||||
paths:
|
||||
- '.github/workflows/test.yml'
|
||||
- 'tests/**'
|
||||
- 'version.cmake'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run Tests"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Clone"
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
- name: "Install Prerequisites"
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt-get install build-essential cmake
|
||||
|
||||
- name: "Run Tests"
|
||||
shell: bash
|
||||
run: |
|
||||
cmake -Htests -Bbuild/tests
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
Copyright 2021 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||
Copyright 2022 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# cmake-version
|
||||
Tired of manually parsing, modifying and comparing versions? Then this may help you! cmake-version is a pure CMake module that supports parsing, modifying, generating and comparing versions in the format specified by Semantic Versioning 1.0.0, Semantic Versioning 2.0.0 and CMake. It also supports a mixture of all formats, for much more functionality.
|
||||
|
||||
## [Documentation](https://xaymar.github.io/cmake-version/)
|
||||
The documentation is generated by Sphinx with the `Read the Docs` theme and is available at [xaymar.github.io/cmake-version/](https://xaymar.github.io/cmake-version/).
|
||||
|
||||
## License
|
||||
> Copyright 2022 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
||||
>
|
||||
> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
>
|
||||
> 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
>
|
||||
> 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
>
|
||||
> 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
>
|
||||
> THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+3
-3
@@ -20,8 +20,8 @@
|
||||
project = 'version'
|
||||
copyright = "2022, Michael Fabian Dirks"
|
||||
author = "Michael Fabian 'Xaymar' Dirks"
|
||||
version = "0.1"
|
||||
release = "0.1"
|
||||
version = "1.2.1"
|
||||
release = "1.2.1"
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
@@ -53,4 +53,4 @@ html_theme = 'sphinx_rtd_theme'
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_static_path = []
|
||||
+73
-5
@@ -1,7 +1,75 @@
|
||||
Version handling for CMake
|
||||
=========================================
|
||||
version
|
||||
-------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
Generate, parse and modify versions purely with CMake. Supports Semantic Versioning 2.0.0, 1.0.0 and other version formats.
|
||||
|
||||
version
|
||||
Synopsis
|
||||
^^^^^^^^
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
version(`PARSE`_ <out-var> <string>)
|
||||
version(`GENERATE`_ <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
version(`MODIFY`_ <out-var> <string> [COMPRESS] [MAJOR <major>] [MINOR <minor] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
version(`COMPARE`_ <out-var> <a> <b>)
|
||||
|
||||
|
||||
The following version constructs are currently supported:
|
||||
|
||||
.. code-block::
|
||||
|
||||
<major> "." <minor> ["." <patch> ["." <tweak>]] [["-"] <pre-release> ["." <pre-release> [...]]] ["+" <build> ["." <build> [...]]]
|
||||
|
||||
Parsing
|
||||
^^^^^^^
|
||||
|
||||
.. _PARSE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(PARSE <out-var> <string>)
|
||||
|
||||
Attempts to parse the version in ``<string>`` and stores the individual compoents into ``<out-var>_<component>``. If a component is not present in the given version, it will be set to a false constant. If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant. The ``PRERELEASE`` and ``BUILD`` components support the dot-separation specifier and will be turned into a list if they are encountered.
|
||||
|
||||
Generating
|
||||
^^^^^^^^^^
|
||||
|
||||
.. _GENERATE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(GENERATE <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
|
||||
Generates a version from the components provided and stores the result in ``<out-var>``. The components ``<major>`` and ``<minor>`` will default to ``0`` if not provided. If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant. The ``PRERELEASE`` and ``BUILD`` components support the dot-separation specifier and will be converted from a list if encountered.
|
||||
|
||||
Modifying
|
||||
^^^^^^^^^
|
||||
|
||||
.. _MODIFY:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(MODIFY <out-var> <string> [COMPRESS] [MAJOR <major>] [MINOR <minor] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
|
||||
Modifies the version provided in ``<string>`` with the components provided. The components ``<major>``, ``<minor>``, ``<patch>`` and ``<tweak>`` may have a prefix of ``+`` or ``-`` to add and subtract the value, or no prefix to replace. The result of this operation will be stored as a string in ``<out-var>``. If a component did not exist in the original, it will be added to the version as a replace operation. If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant.
|
||||
|
||||
Comparing
|
||||
^^^^^^^^^
|
||||
|
||||
.. _COMPARE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(COMPARE <out-var> <a> <b>)
|
||||
|
||||
Compares the version ``<a>`` against ``<b>`` and stores the result in ``<out-var>``. The provided version will be evaluated in the order MAJOR, MINOR, PATCH, TWEAK, PRERELEASE, and then BUILD. The following results should be expected:
|
||||
|
||||
- If a component is only in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``+``.
|
||||
- If a component is only in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``-``.
|
||||
- If a component is numerical and the value is larger in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``>``.
|
||||
- If a component is numerical and the value is larger in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``<``.
|
||||
- If a component is alphanumerical and the value is different in either, ``<out-var>`` will contain the component name with no prefix.
|
||||
- If an error occurred, ``<out-var>_ERROR`` will contain the error message otherwise it will be a false constant, and ``<out-var>`` will be a false constant.
|
||||
- In all other cases, ``<out-var>`` will be a false constant.
|
||||
|
||||
There is no special handling for dot-separated ``PRERELEASE`` and ``BUILD`` component. They will be treated as if they were a string, as special handling for these is up to the application.
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
version
|
||||
-------
|
||||
|
||||
Generate, parse and modify versions purely with CMake. Supports Semantic Versioning 2.0.0, 1.0.0 and other version formats.
|
||||
|
||||
Synopsis
|
||||
^^^^^^^^
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
version(`PARSE`_ <out-var> <string>)
|
||||
version(`GENERATE`_ <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
version(`MODIFY`_ <out-var> <string> [COMPRESS] [MAJOR <major>] [MINOR <minor] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
version(`COMPARE`_ <out-var> <a> <b>)
|
||||
|
||||
|
||||
The following version constructs are currently supported:
|
||||
|
||||
.. code-block::
|
||||
|
||||
<major> "." <minor> ["." <patch> ["." <tweak>]]
|
||||
<major> "." <minor> ["." <patch> ["." <tweak>]] [["-"] <pre-release>] ["+" <build>]
|
||||
|
||||
|
||||
Parsing
|
||||
^^^^^^^
|
||||
|
||||
.. _PARSE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(PARSE <out-var> <string>)
|
||||
|
||||
Attempts to parse the version in ``<string>`` and stores the individual compoents into ``<out-var>_<component>``. If a component is not present in the given version, it will be undefined. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
|
||||
|
||||
Generating
|
||||
^^^^^^^^^^
|
||||
|
||||
.. _GENERATE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(GENERATE <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
|
||||
Generates a version from the components provided and stores the result in ``<out-var>``. The components ``<major>`` and ``<minor>`` will default to ``0`` if not provided. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
|
||||
|
||||
Modifying
|
||||
^^^^^^^^^
|
||||
|
||||
.. _MODIFY:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(MODIFY <out-var> <string> [COMPRESS] [MAJOR <major>] [MINOR <minor] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
|
||||
Modifies the version provided in ``<string>`` with the components provided. The components ``<major>``, ``<minor>``, ``<patch>`` and ``<tweak>`` may have a prefix of ``+`` or ``-`` to add and subtract the value, or no prefix to replace. The result of this operation will be stored as a string in ``<out-var>``. If a component did not exist in the original, it will be added to the version as a replace operation. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
|
||||
|
||||
Comparing
|
||||
^^^^^^^^^
|
||||
|
||||
.. _COMPARE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(COMPARE <out-var> <a> <b>)
|
||||
|
||||
Compares the version ``<a>`` against ``<b>`` and stores the result in ``<out-var>``. The provided version will be evaluated in the order MAJOR, MINOR, PATCH, TWEAK, PRERELEASE, and then BUILD. The following results should be expected:
|
||||
|
||||
- If a component is only in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``+``.
|
||||
- If a component is only in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``-``.
|
||||
- If a component is numerical and the value is larger in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``>``.
|
||||
- If a component is numerical and the value is larger in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``<``.
|
||||
- If a component is alphanumerical and the value is different in either, ``<out-var>`` will contain the component name with no prefix.
|
||||
- In all other cases, ``<out-var>`` will be empty.
|
||||
- If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message, and ``<out-var>`` will be undefined.
|
||||
|
||||
@@ -15,7 +15,9 @@ test_generate("0.0.3" PATCH 3)
|
||||
test_generate("0.0.0.4" TWEAK 4)
|
||||
test_generate("0.0-5" COMPRESS PRERELEASE 5)
|
||||
test_generate("0.0a5" COMPRESS PRERELEASE a5)
|
||||
test_generate("0.0a5.5" COMPRESS PRERELEASE "a5;5")
|
||||
test_generate("0.0+6" BUILD 6)
|
||||
test_generate("0.0+6.8" BUILD "6;8")
|
||||
# - Invalid Cases
|
||||
test_generate("-1.0.0" FAIL MAJOR "-1")
|
||||
test_generate("0.-1.0" FAIL MINOR "-1")
|
||||
@@ -47,6 +49,9 @@ test_parse("1.2.3.4-5+6" MAJOR 1 MINOR 2 PATCH 3 TWEAK 4 PRERELEASE 5 BUILD 6)
|
||||
test_parse("1.2a5+6" MAJOR 1 MINOR 2 PRERELEASE a5 BUILD 6)
|
||||
test_parse("1.2.3a5+6" MAJOR 1 MINOR 2 PATCH 3 PRERELEASE a5 BUILD 6)
|
||||
test_parse("1.2.3.4a5+6" MAJOR 1 MINOR 2 PATCH 3 TWEAK 4 PRERELEASE a5 BUILD 6)
|
||||
test_parse("1.2a5.b5+6.66" MAJOR 1 MINOR 2 PRERELEASE "a5;b5" BUILD "6;66")
|
||||
test_parse("1.2.3a5.b5+6.66" MAJOR 1 MINOR 2 PATCH 3 PRERELEASE "a5;b5" BUILD "6;66")
|
||||
test_parse("1.2.3.4a5.b5+6.66" MAJOR 1 MINOR 2 PATCH 3 TWEAK 4 PRERELEASE "a5;b5" BUILD "6;66")
|
||||
# - Invalid Cases
|
||||
test_parse("" FAIL)
|
||||
test_parse("cmake" FAIL)
|
||||
|
||||
+69
-69
@@ -3,44 +3,44 @@ include("../version.cmake")
|
||||
function(test_generate)
|
||||
cmake_parse_arguments(
|
||||
PARSE_ARGV 1
|
||||
_ARGS
|
||||
_6edc8bbd
|
||||
"COMPRESS;FAIL"
|
||||
"MAJOR;MINOR;PATCH;TWEAK;PRERELEASE;BUILD"
|
||||
""
|
||||
)
|
||||
|
||||
set(ARGS "")
|
||||
if(_ARGS_MAJOR)
|
||||
set(ARGS "${ARGS} MAJOR \"${_ARGS_MAJOR}\"")
|
||||
if(_6edc8bbd_MAJOR)
|
||||
set(ARGS "${ARGS} MAJOR \"${_6edc8bbd_MAJOR}\"")
|
||||
endif()
|
||||
if(_ARGS_MINOR)
|
||||
set(ARGS "${ARGS} MINOR \"${_ARGS_MINOR}\"")
|
||||
if(_6edc8bbd_MINOR)
|
||||
set(ARGS "${ARGS} MINOR \"${_6edc8bbd_MINOR}\"")
|
||||
endif()
|
||||
if(_ARGS_PATCH)
|
||||
set(ARGS "${ARGS} PATCH \"${_ARGS_PATCH}\"")
|
||||
if(_6edc8bbd_PATCH)
|
||||
set(ARGS "${ARGS} PATCH \"${_6edc8bbd_PATCH}\"")
|
||||
endif()
|
||||
if(_ARGS_TWEAK)
|
||||
set(ARGS "${ARGS} TWEAK \"${_ARGS_TWEAK}\"")
|
||||
if(_6edc8bbd_TWEAK)
|
||||
set(ARGS "${ARGS} TWEAK \"${_6edc8bbd_TWEAK}\"")
|
||||
endif()
|
||||
if(_ARGS_PRERELEASE)
|
||||
set(ARGS "${ARGS} PRERELEASE \"${_ARGS_PRERELEASE}\"")
|
||||
if(_6edc8bbd_PRERELEASE)
|
||||
set(ARGS "${ARGS} PRERELEASE \"${_6edc8bbd_PRERELEASE}\"")
|
||||
endif()
|
||||
if(_ARGS_BUILD)
|
||||
set(ARGS "${ARGS} BUILD \"${_ARGS_BUILD}\"")
|
||||
if(_6edc8bbd_BUILD)
|
||||
set(ARGS "${ARGS} BUILD \"${_6edc8bbd_BUILD}\"")
|
||||
endif()
|
||||
if(_ARGS_COMPRESS)
|
||||
if(_6edc8bbd_COMPRESS)
|
||||
set(ARGS "${ARGS} COMPRESS")
|
||||
endif()
|
||||
cmake_language(EVAL CODE "version(GENERATE _TEST ${ARGS})")
|
||||
|
||||
if(DEFINED _TEST_ERROR)
|
||||
if(_ARGS_FAIL)
|
||||
if(_TEST_ERROR)
|
||||
if(_6edc8bbd_FAIL)
|
||||
message(STATUS "PASSED: '${ARGV0}'.\n\t${_TEST_ERROR}")
|
||||
else()
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}'.\n\t${_TEST_ERROR}")
|
||||
endif()
|
||||
else()
|
||||
if((ARGV0 STREQUAL _TEST) AND (NOT _ARGS_FAIL))
|
||||
if((ARGV0 STREQUAL _TEST) AND (NOT _6edc8bbd_FAIL))
|
||||
message(STATUS "PASSED: '${ARGV0}'.")
|
||||
else()
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}' != '${_TEST}'.")
|
||||
@@ -51,7 +51,7 @@ endfunction()
|
||||
function(test_parse)
|
||||
cmake_parse_arguments(
|
||||
PARSE_ARGV 1
|
||||
_ARGS
|
||||
_6edc8bbd
|
||||
"FAIL"
|
||||
"MAJOR;MINOR;PATCH;TWEAK;PRERELEASE;BUILD"
|
||||
""
|
||||
@@ -60,63 +60,63 @@ function(test_parse)
|
||||
|
||||
set(FAILED OFF)
|
||||
set(MESSAGE "${_TEST_ERROR}")
|
||||
if(NOT DEFINED _TEST_ERROR)
|
||||
if(DEFINED _ARGS_MAJOR)
|
||||
if(NOT DEFINED _TEST_MAJOR)
|
||||
if(NOT _TEST_ERROR)
|
||||
if(_6edc8bbd_MAJOR)
|
||||
if(NOT _TEST_MAJOR)
|
||||
set(MESSAGE "MAJOR component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_MAJOR STREQUAL _ARGS_MAJOR))
|
||||
set(MESSAGE "MAJOR component mismatch.")
|
||||
elseif(NOT (_TEST_MAJOR STREQUAL _6edc8bbd_MAJOR))
|
||||
set(MESSAGE "MAJOR component mismatch: '${_TEST_MAJOR}' != '${_6edc8bbd_MAJOR}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED _ARGS_MINOR)
|
||||
if(NOT DEFINED _TEST_MINOR)
|
||||
if(_6edc8bbd_MINOR)
|
||||
if(NOT _TEST_MINOR)
|
||||
set(MESSAGE "MINOR component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_MINOR STREQUAL _ARGS_MINOR))
|
||||
set(MESSAGE "MINOR component mismatch.")
|
||||
elseif(NOT (_TEST_MINOR STREQUAL _6edc8bbd_MINOR))
|
||||
set(MESSAGE "MINOR component mismatch: '${_TEST_MINOR}' != '${_6edc8bbd_MINOR}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED _ARGS_PATCH)
|
||||
if(NOT DEFINED _TEST_PATCH)
|
||||
if(_6edc8bbd_PATCH)
|
||||
if(NOT _TEST_PATCH)
|
||||
set(MESSAGE "PATCH component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_PATCH STREQUAL _ARGS_PATCH))
|
||||
set(MESSAGE "PATCH component mismatch.")
|
||||
elseif(NOT (_TEST_PATCH STREQUAL _6edc8bbd_PATCH))
|
||||
set(MESSAGE "PATCH component mismatch: '${_TEST_PATCH}' != '${_6edc8bbd_PATCH}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED _ARGS_TWEAK)
|
||||
if(NOT DEFINED _TEST_TWEAK)
|
||||
if(_6edc8bbd_TWEAK)
|
||||
if(NOT _TEST_TWEAK)
|
||||
set(MESSAGE "TWEAK component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_TWEAK STREQUAL _ARGS_TWEAK))
|
||||
set(MESSAGE "TWEAK component mismatch.")
|
||||
elseif(NOT (_TEST_TWEAK STREQUAL _6edc8bbd_TWEAK))
|
||||
set(MESSAGE "TWEAK component mismatch: '${_TEST_TWEAK}' != '${_6edc8bbd_TWEAK}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED _ARGS_PRERELEASE)
|
||||
if(NOT DEFINED _TEST_PRERELEASE)
|
||||
if(_6edc8bbd_PRERELEASE)
|
||||
if(NOT _TEST_PRERELEASE)
|
||||
set(MESSAGE "PRERELEASE component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_PRERELEASE STREQUAL _ARGS_PRERELEASE))
|
||||
set(MESSAGE "PRERELEASE component mismatch.")
|
||||
elseif(NOT (_TEST_PRERELEASE STREQUAL _6edc8bbd_PRERELEASE))
|
||||
set(MESSAGE "PRERELEASE component mismatch: '${_TEST_PRERELEASE}' != '${_6edc8bbd_PRERELEASE}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(DEFINED _ARGS_BUILD)
|
||||
if(NOT DEFINED _TEST_BUILD)
|
||||
if(_6edc8bbd_BUILD)
|
||||
if(NOT _TEST_BUILD)
|
||||
set(MESSAGE "BUILD component missing during parse.")
|
||||
set(FAILED ON)
|
||||
elseif(NOT (_TEST_BUILD STREQUAL _ARGS_BUILD))
|
||||
set(MESSAGE "BUILD component mismatch.")
|
||||
elseif(NOT (_TEST_BUILD STREQUAL _6edc8bbd_BUILD))
|
||||
set(MESSAGE "BUILD component mismatch: '${_TEST_BUILD}' != '${_6edc8bbd_BUILD}'")
|
||||
set(FAILED ON)
|
||||
endif()
|
||||
endif()
|
||||
@@ -125,13 +125,13 @@ function(test_parse)
|
||||
endif()
|
||||
|
||||
if(FAILED)
|
||||
if(_ARGS_FAIL)
|
||||
if(_6edc8bbd_FAIL)
|
||||
message(STATUS "PASSED: '${ARGV0}'.\n\t${MESSAGE}")
|
||||
else()
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}'.\n\t${MESSAGE}")
|
||||
endif()
|
||||
else()
|
||||
if(_ARGS_FAIL)
|
||||
if(_6edc8bbd_FAIL)
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}'.")
|
||||
else()
|
||||
message(STATUS "PASSED: '${ARGV0}'.")
|
||||
@@ -142,38 +142,38 @@ endfunction()
|
||||
function(test_modify)
|
||||
cmake_parse_arguments(
|
||||
PARSE_ARGV 2
|
||||
_ARGS
|
||||
_6edc8bbd
|
||||
"FAIL;COMPRESS"
|
||||
"MAJOR;MINOR;PATCH;TWEAK;PRERELEASE;BUILD"
|
||||
""
|
||||
)
|
||||
|
||||
set(ARGS "")
|
||||
if(_ARGS_MAJOR)
|
||||
set(ARGS "${ARGS} MAJOR \"${_ARGS_MAJOR}\"")
|
||||
if(_6edc8bbd_MAJOR)
|
||||
set(ARGS "${ARGS} MAJOR \"${_6edc8bbd_MAJOR}\"")
|
||||
endif()
|
||||
if(_ARGS_MINOR)
|
||||
set(ARGS "${ARGS} MINOR \"${_ARGS_MINOR}\"")
|
||||
if(_6edc8bbd_MINOR)
|
||||
set(ARGS "${ARGS} MINOR \"${_6edc8bbd_MINOR}\"")
|
||||
endif()
|
||||
if(_ARGS_PATCH)
|
||||
set(ARGS "${ARGS} PATCH \"${_ARGS_PATCH}\"")
|
||||
if(_6edc8bbd_PATCH)
|
||||
set(ARGS "${ARGS} PATCH \"${_6edc8bbd_PATCH}\"")
|
||||
endif()
|
||||
if(_ARGS_TWEAK)
|
||||
set(ARGS "${ARGS} TWEAK \"${_ARGS_TWEAK}\"")
|
||||
if(_6edc8bbd_TWEAK)
|
||||
set(ARGS "${ARGS} TWEAK \"${_6edc8bbd_TWEAK}\"")
|
||||
endif()
|
||||
if(_ARGS_PRERELEASE)
|
||||
set(ARGS "${ARGS} PRERELEASE \"${_ARGS_PRERELEASE}\"")
|
||||
if(_6edc8bbd_PRERELEASE)
|
||||
set(ARGS "${ARGS} PRERELEASE \"${_6edc8bbd_PRERELEASE}\"")
|
||||
endif()
|
||||
if(_ARGS_BUILD)
|
||||
set(ARGS "${ARGS} BUILD \"${_ARGS_BUILD}\"")
|
||||
if(_6edc8bbd_BUILD)
|
||||
set(ARGS "${ARGS} BUILD \"${_6edc8bbd_BUILD}\"")
|
||||
endif()
|
||||
if(_ARGS_COMPRESS)
|
||||
if(_6edc8bbd_COMPRESS)
|
||||
set(ARGS "${ARGS} COMPRESS")
|
||||
endif()
|
||||
cmake_language(EVAL CODE "version(MODIFY _TEST \"${ARGV1}\" ${ARGS})")
|
||||
|
||||
set(FAILED OFF)
|
||||
if(DEFINED _TEST_ERROR)
|
||||
if(_TEST_ERROR)
|
||||
set(MESSAGE "${_TEST_ERROR}")
|
||||
set(FAILED ON)
|
||||
else()
|
||||
@@ -183,16 +183,16 @@ function(test_modify)
|
||||
endif()
|
||||
|
||||
if(FAILED)
|
||||
if(_ARGS_FAIL)
|
||||
message(STATUS "PASSED: '${ARGV0}'.\n\t${MESSAGE}")
|
||||
if(_6edc8bbd_FAIL)
|
||||
message(STATUS "PASSED: '${ARGV0}' != '${_TEST}'.\n\t${MESSAGE}")
|
||||
else()
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}' != '${_TEST}'.\n\t${MESSAGE}")
|
||||
endif()
|
||||
else()
|
||||
if(_ARGS_FAIL)
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}' != '${_TEST}'.\n\t${MESSAGE}")
|
||||
if(_6edc8bbd_FAIL)
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}' == '${_TEST}'.\n\t${MESSAGE}")
|
||||
else()
|
||||
message(STATUS "PASSED: '${ARGV0}'.")
|
||||
message(STATUS "PASSED: '${ARGV0}' == '${_TEST}'.")
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
@@ -200,7 +200,7 @@ endfunction()
|
||||
function(test_compare)
|
||||
cmake_parse_arguments(
|
||||
PARSE_ARGV 3
|
||||
_ARGS
|
||||
_6edc8bbd
|
||||
"FAIL"
|
||||
"RESULT"
|
||||
""
|
||||
@@ -208,7 +208,7 @@ function(test_compare)
|
||||
|
||||
version(COMPARE _TEST "${ARGV0}" "${ARGV2}")
|
||||
set(FAILED OFF)
|
||||
if(DEFINED _TEST_ERROR)
|
||||
if(_TEST_ERROR)
|
||||
set(MESSAGE "${_TEST_ERROR}")
|
||||
set(FAILED ON)
|
||||
else()
|
||||
@@ -219,13 +219,13 @@ function(test_compare)
|
||||
endif()
|
||||
|
||||
if(FAILED)
|
||||
if(_ARGS_FAIL)
|
||||
if(_6edc8bbd_FAIL)
|
||||
message(STATUS "PASSED: '${ARGV0}' '${ARGV1}' '${ARGV2}'.\n\t${MESSAGE}")
|
||||
else()
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}' '${ARGV1}' '${ARGV2}'.\n\t${MESSAGE}")
|
||||
endif()
|
||||
else()
|
||||
if(_ARGS_FAIL)
|
||||
if(_6edc8bbd_FAIL)
|
||||
message(SEND_ERROR "FAILED: '${ARGV0}' '${ARGV1}' '${ARGV2}'.\n\t${MESSAGE}")
|
||||
else()
|
||||
message(STATUS "PASSED: '${ARGV0}' '${ARGV1}' '${ARGV2}'.")
|
||||
|
||||
+263
-136
@@ -10,13 +10,91 @@
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
# For SemVer 2.0.0
|
||||
#[=======================================================================[.rst:
|
||||
version
|
||||
-------
|
||||
|
||||
Generate, parse and modify versions purely with CMake. Supports Semantic Versioning 2.0.0, 1.0.0 and other version formats.
|
||||
|
||||
Synopsis
|
||||
^^^^^^^^
|
||||
|
||||
.. parsed-literal::
|
||||
|
||||
version(`PARSE`_ <out-var> <string>)
|
||||
version(`GENERATE`_ <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
version(`MODIFY`_ <out-var> <string> [COMPRESS] [MAJOR <major>] [MINOR <minor] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
version(`COMPARE`_ <out-var> <a> <b>)
|
||||
|
||||
|
||||
The following version constructs are currently supported:
|
||||
|
||||
.. code-block::
|
||||
|
||||
<major> "." <minor> ["." <patch> ["." <tweak>]]
|
||||
<major> "." <minor> ["." <patch> ["." <tweak>]] [["-"] <pre-release>] ["+" <build>]
|
||||
|
||||
|
||||
Parsing
|
||||
^^^^^^^
|
||||
|
||||
.. _PARSE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(PARSE <out-var> <string>)
|
||||
|
||||
Attempts to parse the version in ``<string>`` and stores the individual compoents into ``<out-var>_<component>``. If a component is not present in the given version, it will be undefined. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
|
||||
|
||||
Generating
|
||||
^^^^^^^^^^
|
||||
|
||||
.. _GENERATE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(GENERATE <out-var> [COMPRESS] [MAJOR <major>] [MINOR <minor>] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
|
||||
Generates a version from the components provided and stores the result in ``<out-var>``. The components ``<major>`` and ``<minor>`` will default to ``0`` if not provided. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
|
||||
|
||||
Modifying
|
||||
^^^^^^^^^
|
||||
|
||||
.. _MODIFY:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(MODIFY <out-var> <string> [COMPRESS] [MAJOR <major>] [MINOR <minor] [PATCH <patch>] [TWEAK <tweak>] [PRERELEASE <prerelease>] [BUILD <build>])
|
||||
|
||||
Modifies the version provided in ``<string>`` with the components provided. The components ``<major>``, ``<minor>``, ``<patch>`` and ``<tweak>`` may have a prefix of ``+`` or ``-`` to add and subtract the value, or no prefix to replace. The result of this operation will be stored as a string in ``<out-var>``. If a component did not exist in the original, it will be added to the version as a replace operation. If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message.
|
||||
|
||||
Comparing
|
||||
^^^^^^^^^
|
||||
|
||||
.. _COMPARE:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
version(COMPARE <out-var> <a> <b>)
|
||||
|
||||
Compares the version ``<a>`` against ``<b>`` and stores the result in ``<out-var>``. The provided version will be evaluated in the order MAJOR, MINOR, PATCH, TWEAK, PRERELEASE, and then BUILD. The following results should be expected:
|
||||
|
||||
- If a component is only in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``+``.
|
||||
- If a component is only in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``-``.
|
||||
- If a component is numerical and the value is larger in ``<a>``, ``<out-var>`` will contain the componenent name prefixed by ``>``.
|
||||
- If a component is numerical and the value is larger in ``<b>``, ``<out-var>`` will contain the componenent name prefixed by ``<``.
|
||||
- If a component is alphanumerical and the value is different in either, ``<out-var>`` will contain the component name with no prefix.
|
||||
- In all other cases, ``<out-var>`` will be empty.
|
||||
- If an error occurred, ``<out-var>_ERROR`` will be defined and contain the error message, and ``<out-var>`` will be undefined.
|
||||
#]=======================================================================]
|
||||
|
||||
function(version)
|
||||
unset(${OUT_VAR} PARENT_SCOPE)
|
||||
unset(${OUT_VAR}_ERROR PARENT_SCOPE)
|
||||
# CMake functions do not have their own proper scope, they act more
|
||||
|
||||
set(OUT_VAR "${ARGV1}")
|
||||
set(_ "")
|
||||
|
||||
# Force clean parent elements.
|
||||
set(${OUT_VAR}_ERROR "" PARENT_SCOPE)
|
||||
|
||||
string(TOUPPER "${ARGV0}" ARGV0)
|
||||
if(ARGV0 STREQUAL "PARSE")
|
||||
@@ -38,146 +116,167 @@ function(version)
|
||||
string(SUBSTRING "${CMAKE_MATCH_3}" 1 -1 _TMP)
|
||||
set(${OUT_VAR}_PATCH "${_TMP}" PARENT_SCOPE)
|
||||
else()
|
||||
unset(${OUT_VAR}_PATCH PARENT_SCOPE)
|
||||
set(${OUT_VAR}_PATCH "" PARENT_SCOPE)
|
||||
endif()
|
||||
# {4} = Tweak
|
||||
if(CMAKE_MATCH_4)
|
||||
string(SUBSTRING "${CMAKE_MATCH_4}" 1 -1 _TMP)
|
||||
set(${OUT_VAR}_TWEAK "${_TMP}" PARENT_SCOPE)
|
||||
else()
|
||||
unset(${OUT_VAR}_TWEAK PARENT_SCOPE)
|
||||
set(${OUT_VAR}_TWEAK "" PARENT_SCOPE)
|
||||
endif()
|
||||
# {5} = PreRelease
|
||||
if(CMAKE_MATCH_5)
|
||||
string(REPLACE "." ";" CMAKE_MATCH_5 "${CMAKE_MATCH_5}") # Handle dot separation as list.
|
||||
string(SUBSTRING "${CMAKE_MATCH_5}" 0 1 _TMP)
|
||||
if(_TMP STREQUAL "-")
|
||||
string(SUBSTRING "${CMAKE_MATCH_5}" 1 -1 _TMP)
|
||||
set(${OUT_VAR}_PRERELEASE "${_TMP}" PARENT_SCOPE)
|
||||
string(SUBSTRING "${CMAKE_MATCH_5}" 1 -1 CMAKE_MATCH_5)
|
||||
set(${OUT_VAR}_PRERELEASE "${CMAKE_MATCH_5}" PARENT_SCOPE)
|
||||
else()
|
||||
set(${OUT_VAR}_PRERELEASE "${CMAKE_MATCH_5}" PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
unset(${OUT_VAR}_PRERELEASE PARENT_SCOPE)
|
||||
set(${OUT_VAR}_PRERELEASE "" PARENT_SCOPE)
|
||||
endif()
|
||||
# {6} = Build
|
||||
if(CMAKE_MATCH_6)
|
||||
string(SUBSTRING "${CMAKE_MATCH_6}" 1 -1 _TMP)
|
||||
set(${OUT_VAR}_BUILD "${_TMP}" PARENT_SCOPE)
|
||||
string(REPLACE "." ";" CMAKE_MATCH_6 "${CMAKE_MATCH_6}") # Handle dot separation as list.
|
||||
string(SUBSTRING "${CMAKE_MATCH_6}" 1 -1 CMAKE_MATCH_6)
|
||||
set(${OUT_VAR}_BUILD "${CMAKE_MATCH_6}" PARENT_SCOPE)
|
||||
else()
|
||||
unset(${OUT_VAR}_BUILD PARENT_SCOPE)
|
||||
set(${OUT_VAR}_BUILD "" PARENT_SCOPE)
|
||||
endif()
|
||||
elseif(ARGV0 STREQUAL "GENERATE")
|
||||
set(_feeb1eff "")
|
||||
set(_32070faa "")
|
||||
set(_32070faa_MAJOR "")
|
||||
set(_32070faa_MINOR "")
|
||||
set(_32070faa_PATCH "")
|
||||
set(_32070faa_TWEAK "")
|
||||
set(_32070faa_PRERELEASE "")
|
||||
set(_32070faa_BUILD "")
|
||||
set(_32070faa_ERROR "")
|
||||
cmake_parse_arguments(
|
||||
PARSE_ARGV 2
|
||||
_ARGS
|
||||
_32070faa
|
||||
"COMPRESS"
|
||||
"MAJOR;MINOR;PATCH;TWEAK;PRERELEASE;BUILD"
|
||||
""
|
||||
)
|
||||
|
||||
# Do we have the major component, and is it valid?
|
||||
if(DEFINED _ARGS_MAJOR)
|
||||
string(STRIP "${_ARGS_MAJOR}" _ARGS_MAJOR)
|
||||
if(_ARGS_MAJOR STREQUAL "")
|
||||
set(_ARGS_MAJOR 0)
|
||||
elseif(NOT (_ARGS_MAJOR MATCHES [[^[0-9]+$]]))
|
||||
set(${OUT_VAR}_ERROR "MAJOR component must be a numeric identifier, but is: '${_ARGS_MAJOR}'" PARENT_SCOPE)
|
||||
if(_32070faa_MAJOR)
|
||||
string(STRIP "${_32070faa_MAJOR}" _32070faa_MAJOR)
|
||||
if(_32070faa_MAJOR STREQUAL "")
|
||||
set(_32070faa_MAJOR 0)
|
||||
elseif(NOT (_32070faa_MAJOR MATCHES [[^[0-9]+$]]))
|
||||
set(${OUT_VAR}_ERROR "MAJOR component must be a numeric identifier, but is: '${_32070faa_MAJOR}'" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
set(_ARGS_MAJOR 0)
|
||||
set(_32070faa_MAJOR 0)
|
||||
endif()
|
||||
set(_ "${_}${_ARGS_MAJOR}")
|
||||
set(_feeb1eff "${_feeb1eff}${_32070faa_MAJOR}")
|
||||
|
||||
# Do we have the minor component, and is it valid?
|
||||
if(DEFINED _ARGS_MINOR)
|
||||
string(STRIP "${_ARGS_MINOR}" _ARGS_MINOR)
|
||||
if(_ARGS_MINOR STREQUAL "")
|
||||
set(_ARGS_MINOR 0)
|
||||
elseif(NOT (_ARGS_MINOR MATCHES [[^[0-9]+$]]))
|
||||
set(${OUT_VAR}_ERROR "MINOR component must be a numeric identifier, but is: '${_ARGS_MINOR}'" PARENT_SCOPE)
|
||||
if(_32070faa_MINOR)
|
||||
string(STRIP "${_32070faa_MINOR}" _32070faa_MINOR)
|
||||
if(_32070faa_MINOR STREQUAL "")
|
||||
set(_32070faa_MINOR 0)
|
||||
elseif(NOT (_32070faa_MINOR MATCHES [[^[0-9]+$]]))
|
||||
set(${OUT_VAR}_ERROR "MINOR component must be a numeric identifier, but is: '${_32070faa_MINOR}'" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
else()
|
||||
set(_ARGS_MINOR 0)
|
||||
set(_32070faa_MINOR 0)
|
||||
endif()
|
||||
set(_ "${_}.${_ARGS_MINOR}")
|
||||
set(_feeb1eff "${_feeb1eff}.${_32070faa_MINOR}")
|
||||
|
||||
# Do we have the patch component, and is it valid?
|
||||
if(DEFINED _ARGS_PATCH)
|
||||
string(STRIP "${_ARGS_PATCH}" _ARGS_PATCH)
|
||||
if(_ARGS_PATCH STREQUAL "")
|
||||
unset(_ARGS_PATCH)
|
||||
elseif(_ARGS_PATCH MATCHES [[^[0-9]+$]])
|
||||
set(_ "${_}.${_ARGS_PATCH}")
|
||||
if(_32070faa_PATCH)
|
||||
string(STRIP "${_32070faa_PATCH}" _32070faa_PATCH)
|
||||
if(_32070faa_PATCH STREQUAL "")
|
||||
unset(_32070faa_PATCH)
|
||||
elseif(_32070faa_PATCH MATCHES [[^[0-9]+$]])
|
||||
set(_feeb1eff "${_feeb1eff}.${_32070faa_PATCH}")
|
||||
else()
|
||||
set(${OUT_VAR}_ERROR "PATCH component must be a numeric identifier, but is: '${_ARGS_PATCH}'" PARENT_SCOPE)
|
||||
set(${OUT_VAR}_ERROR "PATCH component must be a numeric identifier, but is: '${_32070faa_PATCH}'" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Do we have the tweak component, and is it valid?
|
||||
if(DEFINED _ARGS_TWEAK)
|
||||
string(STRIP "${_ARGS_TWEAK}" _ARGS_TWEAK)
|
||||
if(_ARGS_TWEAK STREQUAL "")
|
||||
unset(_ARGS_TWEAK)
|
||||
elseif(_ARGS_TWEAK MATCHES [[^[0-9]+$]])
|
||||
if(NOT DEFINED _ARGS_PATCH)
|
||||
set(_ "${_}.0")
|
||||
if(_32070faa_TWEAK)
|
||||
string(STRIP "${_32070faa_TWEAK}" _32070faa_TWEAK)
|
||||
if(_32070faa_TWEAK STREQUAL "")
|
||||
unset(_32070faa_TWEAK)
|
||||
elseif(_32070faa_TWEAK MATCHES [[^[0-9]+$]])
|
||||
if(NOT _32070faa_PATCH)
|
||||
set(_feeb1eff "${_feeb1eff}.0")
|
||||
endif()
|
||||
set(_ "${_}.${_ARGS_TWEAK}")
|
||||
set(_feeb1eff "${_feeb1eff}.${_32070faa_TWEAK}")
|
||||
else()
|
||||
set(${OUT_VAR}_ERROR "TWEAK component must be a numeric identifier, but is: '${_ARGS_TWEAK}'" PARENT_SCOPE)
|
||||
set(${OUT_VAR}_ERROR "TWEAK component must be a numeric identifier, but is: '${_32070faa_TWEAK}'" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Do we have the pre-release component, and is it valid?
|
||||
if(DEFINED _ARGS_PRERELEASE)
|
||||
string(STRIP "${_ARGS_PRERELEASE}" _ARGS_PRERELEASE)
|
||||
if(_ARGS_PRERELEASE STREQUAL "")
|
||||
unset(_ARGS_PRERELEASE)
|
||||
elseif(_ARGS_PRERELEASE MATCHES [[^[a-zA-Z0-9]+[a-zA-Z0-9\-\.]*$]])
|
||||
if(_ARGS_COMPRESS AND (_ARGS_PRERELEASE MATCHES [[[a-zA-Z]+[a-zA-Z0-9\\-\\.]*$]]))
|
||||
set(_ "${_}${_ARGS_PRERELEASE}")
|
||||
if(_32070faa_PRERELEASE)
|
||||
string(STRIP "${_32070faa_PRERELEASE}" _32070faa_PRERELEASE)
|
||||
list(JOIN _32070faa_PRERELEASE "." _32070faa_PRERELEASE)
|
||||
if(_32070faa_PRERELEASE STREQUAL "")
|
||||
unset(_32070faa_PRERELEASE)
|
||||
elseif(_32070faa_PRERELEASE MATCHES [[^[a-zA-Z0-9]+[a-zA-Z0-9\-\.]*$]])
|
||||
if(_32070faa_COMPRESS AND (_32070faa_PRERELEASE MATCHES [[[a-zA-Z]+[a-zA-Z0-9\-\.]*$]]))
|
||||
set(_feeb1eff "${_feeb1eff}${_32070faa_PRERELEASE}")
|
||||
else()
|
||||
set(_ "${_}-${_ARGS_PRERELEASE}")
|
||||
set(_feeb1eff "${_feeb1eff}-${_32070faa_PRERELEASE}")
|
||||
endif()
|
||||
else()
|
||||
set(${OUT_VAR}_ERROR "PRERELEASE component must be an alphanumeric identifier, but is: '${_ARGS_PRERELEASE}'" PARENT_SCOPE)
|
||||
set(${OUT_VAR}_ERROR "PRERELEASE component must be an alphanumeric identifier, but is: '${_32070faa_PRERELEASE}'" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Do we have the build component, and is it valid?
|
||||
if(DEFINED _ARGS_BUILD)
|
||||
string(STRIP "${_ARGS_BUILD}" _ARGS_PRERELEASE)
|
||||
if(_ARGS_BUILD STREQUAL "")
|
||||
unset(_ARGS_BUILD)
|
||||
elseif(_ARGS_BUILD MATCHES [[^[a-zA-Z0-9]+[a-zA-Z0-9\-\.]*$]])
|
||||
set(_ "${_}+${_ARGS_BUILD}")
|
||||
if(_32070faa_BUILD)
|
||||
string(STRIP "${_32070faa_BUILD}" _32070faa_PRERELEASE)
|
||||
list(JOIN _32070faa_BUILD "." _32070faa_BUILD)
|
||||
if(_32070faa_BUILD STREQUAL "")
|
||||
unset(_32070faa_BUILD)
|
||||
elseif(_32070faa_BUILD MATCHES [[^[a-zA-Z0-9]+[a-zA-Z0-9\-\.]*$]])
|
||||
set(_feeb1eff "${_feeb1eff}+${_32070faa_BUILD}")
|
||||
else()
|
||||
set(${OUT_VAR}_ERROR "BUILD component must be an alphanumeric identifier, but is: '${_ARGS_BUILD}'" PARENT_SCOPE)
|
||||
set(${OUT_VAR}_ERROR "BUILD component must be an alphanumeric identifier, but is: '${_32070faa_BUILD}'" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(${OUT_VAR} "${_}" PARENT_SCOPE)
|
||||
set(${OUT_VAR} "${_feeb1eff}" PARENT_SCOPE)
|
||||
elseif(ARGV0 STREQUAL "MODIFY")
|
||||
# Requires PARSE and GENERATE.
|
||||
set(_fe7bcddd "")
|
||||
set(_fe7bcddd_MAJOR "")
|
||||
set(_fe7bcddd_MINOR "")
|
||||
set(_fe7bcddd_PATCH "")
|
||||
set(_fe7bcddd_TWEAK "")
|
||||
set(_fe7bcddd_PRERELEASE "")
|
||||
set(_fe7bcddd_BUILD "")
|
||||
set(_fe7bcddd_ERROR "")
|
||||
cmake_parse_arguments(
|
||||
PARSE_ARGV 3
|
||||
_ARGS
|
||||
_fe7bcddd
|
||||
"COMPRESS"
|
||||
"MAJOR;MINOR;PATCH;BUILD;PRERELEASE;COMMIT"
|
||||
"MAJOR;MINOR;PATCH;TWEAK;PRERELEASE;BUILD"
|
||||
""
|
||||
)
|
||||
|
||||
# Helpers
|
||||
macro(modify_version_number)
|
||||
if(DEFINED ${ARGV1})
|
||||
if(${ARGV1})
|
||||
if(${ARGV1} MATCHES "^(\\+|\\-)([0-9]+)$")
|
||||
if(DEFINED ${ARGV0})
|
||||
if(${ARGV0})
|
||||
math(EXPR ${ARGV0} "${${ARGV0}} ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}")
|
||||
else()
|
||||
math(EXPR ${ARGV0} "0 ${CMAKE_MATCH_1} ${CMAKE_MATCH_2}")
|
||||
@@ -189,145 +288,173 @@ function(version)
|
||||
endmacro()
|
||||
|
||||
# Parse the given version.
|
||||
version(PARSE _TEMP "${ARGV2}")
|
||||
if(DEFINED _TEMP_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_TEMP_ERROR} PARENT_SCOPE)
|
||||
set(_df8abcce "")
|
||||
set(_df8abcce_MAJOR "")
|
||||
set(_df8abcce_MINOR "")
|
||||
set(_df8abcce_PATCH "")
|
||||
set(_df8abcce_TWEAK "")
|
||||
set(_df8abcce_PRERELEASE "")
|
||||
set(_df8abcce_BUILD "")
|
||||
set(_df8abcce_ERROR "")
|
||||
version(PARSE _df8abcce "${ARGV2}")
|
||||
if(_df8abcce_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_df8abcce_ERROR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Modify core version components
|
||||
modify_version_number(_TEMP_MAJOR _ARGS_MAJOR)
|
||||
modify_version_number(_TEMP_MINOR _ARGS_MINOR)
|
||||
modify_version_number(_TEMP_PATCH _ARGS_PATCH)
|
||||
modify_version_number(_TEMP_TWEAK _ARGS_TWEAK)
|
||||
modify_version_number(_df8abcce_MAJOR _fe7bcddd_MAJOR)
|
||||
modify_version_number(_df8abcce_MINOR _fe7bcddd_MINOR)
|
||||
modify_version_number(_df8abcce_PATCH _fe7bcddd_PATCH)
|
||||
modify_version_number(_df8abcce_TWEAK _fe7bcddd_TWEAK)
|
||||
|
||||
# Replace other components if defined.
|
||||
if(DEFINED _ARGS_PRERELEASE)
|
||||
set(_TEMP_PRERELEASE "${_ARGS_PRERELEASE}")
|
||||
if(_fe7bcddd_PRERELEASE)
|
||||
set(_df8abcce_PRERELEASE "${_fe7bcddd_PRERELEASE}")
|
||||
endif()
|
||||
if(DEFINED _ARGS_BUILD)
|
||||
set(_TEMP_BUILD "${_ARGS_BUILD}")
|
||||
if(_fe7bcddd_BUILD)
|
||||
set(_df8abcce_BUILD "${_fe7bcddd_BUILD}")
|
||||
endif()
|
||||
|
||||
# Generate a new version.
|
||||
set(_ARGS "")
|
||||
if(DEFINED _TEMP_MAJOR AND (NOT _TEMP_MAJOR STREQUAL ""))
|
||||
set(_ARGS "${_ARGS} MAJOR \"${_TEMP_MAJOR}\"")
|
||||
set(_fe7bcddd_GEN "")
|
||||
if(_df8abcce_MAJOR AND (NOT _df8abcce_MAJOR STREQUAL ""))
|
||||
set(_fe7bcddd_GEN "${_fe7bcddd_GEN} MAJOR \"${_df8abcce_MAJOR}\"")
|
||||
endif()
|
||||
if(DEFINED _TEMP_MINOR AND (NOT _TEMP_MINOR STREQUAL ""))
|
||||
set(_ARGS "${_ARGS} MINOR \"${_TEMP_MINOR}\"")
|
||||
if(_df8abcce_MINOR AND (NOT _df8abcce_MINOR STREQUAL ""))
|
||||
set(_fe7bcddd_GEN "${_fe7bcddd_GEN} MINOR \"${_df8abcce_MINOR}\"")
|
||||
endif()
|
||||
if(DEFINED _TEMP_PATCH AND (NOT _TEMP_PATCH STREQUAL ""))
|
||||
set(_ARGS "${_ARGS} PATCH \"${_TEMP_PATCH}\"")
|
||||
if(_df8abcce_PATCH AND (NOT _df8abcce_PATCH STREQUAL ""))
|
||||
set(_fe7bcddd_GEN "${_fe7bcddd_GEN} PATCH \"${_df8abcce_PATCH}\"")
|
||||
endif()
|
||||
if(DEFINED _TEMP_TWEAK AND (NOT _TEMP_TWEAK STREQUAL ""))
|
||||
set(_ARGS "${_ARGS} TWEAK \"${_TEMP_TWEAK}\"")
|
||||
if(_df8abcce_TWEAK AND (NOT _df8abcce_TWEAK STREQUAL ""))
|
||||
set(_fe7bcddd_GEN "${_fe7bcddd_GEN} TWEAK \"${_df8abcce_TWEAK}\"")
|
||||
endif()
|
||||
if(DEFINED _TEMP_PRERELEASE AND (NOT _TEMP_PRERELEASE STREQUAL ""))
|
||||
set(_ARGS "${_ARGS} PRERELEASE \"${_TEMP_PRERELEASE}\"")
|
||||
if(_df8abcce_PRERELEASE AND (NOT _df8abcce_PRERELEASE STREQUAL ""))
|
||||
set(_fe7bcddd_GEN "${_fe7bcddd_GEN} PRERELEASE \"${_df8abcce_PRERELEASE}\"")
|
||||
endif()
|
||||
if(DEFINED _TEMP_BUILD AND (NOT _TEMP_BUILD STREQUAL ""))
|
||||
set(_ARGS "${_ARGS} BUILD \"${_TEMP_BUILD}\"")
|
||||
if(_df8abcce_BUILD AND (NOT _df8abcce_BUILD STREQUAL ""))
|
||||
set(_fe7bcddd_GEN "${_fe7bcddd_GEN} BUILD \"${_df8abcce_BUILD}\"")
|
||||
endif()
|
||||
if(DEFINED _ARGS_COMPRESS)
|
||||
set(_ARGS "${_ARGS} COMPRESS")
|
||||
if(_fe7bcddd_COMPRESS)
|
||||
set(_fe7bcddd_GEN "${_fe7bcddd_GEN} COMPRESS")
|
||||
endif()
|
||||
cmake_language(EVAL CODE "version(GENERATE _TEMP ${_ARGS})")
|
||||
if(DEFINED _TEMP_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_TEMP_ERROR} PARENT_SCOPE)
|
||||
cmake_language(EVAL CODE "version(GENERATE _df8abcce ${_fe7bcddd_GEN})")
|
||||
if(_df8abcce_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_df8abcce_ERROR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
set(${OUT_VAR} "${_TEMP}" PARENT_SCOPE)
|
||||
set(${OUT_VAR} "${_df8abcce}" PARENT_SCOPE)
|
||||
elseif(ARGV0 STREQUAL "COMPARE")
|
||||
# Requires PARSE.
|
||||
|
||||
# Parse first version
|
||||
version(PARSE _A "${ARGV2}")
|
||||
if(DEFINED _A_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_A_ERROR} PARENT_SCOPE)
|
||||
set(_00fdeadb "")
|
||||
set(_00fdeadb_MAJOR "")
|
||||
set(_00fdeadb_MINOR "")
|
||||
set(_00fdeadb_PATCH "")
|
||||
set(_00fdeadb_TWEAK "")
|
||||
set(_00fdeadb_PRERELEASE "")
|
||||
set(_00fdeadb_BUILD "")
|
||||
set(_00fdeadb_ERROR "")
|
||||
version(PARSE _00fdeadb "${ARGV2}")
|
||||
if(_00fdeadb_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_00fdeadb_ERROR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Parse second version
|
||||
version(PARSE _B "${ARGV3}")
|
||||
if(DEFINED _B_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_B_ERROR} PARENT_SCOPE)
|
||||
set(_ca75feel "")
|
||||
set(_ca75feel_MAJOR "")
|
||||
set(_ca75feel_MINOR "")
|
||||
set(_ca75feel_PATCH "")
|
||||
set(_ca75feel_TWEAK "")
|
||||
set(_ca75feel_PRERELEASE "")
|
||||
set(_ca75feel_BUILD "")
|
||||
set(_ca75feel_ERROR "")
|
||||
version(PARSE _ca75feel "${ARGV3}")
|
||||
if(_ca75feel_ERROR)
|
||||
set(${OUT_VAR}_ERROR ${_ca75feel_ERROR} PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Major
|
||||
if(_A_MAJOR GREATER _B_MAJOR)
|
||||
if(_00fdeadb_MAJOR GREATER _ca75feel_MAJOR)
|
||||
set(${OUT_VAR} ">MAJOR" PARENT_SCOPE)
|
||||
return()
|
||||
elseif(_A_MAJOR LESS _B_MAJOR)
|
||||
elseif(_00fdeadb_MAJOR LESS _ca75feel_MAJOR)
|
||||
set(${OUT_VAR} "<MAJOR" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Minor
|
||||
if(_A_MINOR GREATER _B_MINOR)
|
||||
if(_00fdeadb_MINOR GREATER _ca75feel_MINOR)
|
||||
set(${OUT_VAR} ">MINOR" PARENT_SCOPE)
|
||||
return()
|
||||
elseif(_A_MINOR LESS _B_MINOR)
|
||||
elseif(_00fdeadb_MINOR LESS _ca75feel_MINOR)
|
||||
set(${OUT_VAR} "<MINOR" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Patch
|
||||
if((DEFINED _A_PATCH OR DEFINED _B_PATCH) AND ((NOT DEFINED _A_PATCH) OR (NOT DEFINED _B_PATCH)))
|
||||
if(DEFINED _A_PATCH)
|
||||
set(${OUT_VAR} "+PATCH" PARENT_SCOPE)
|
||||
else()
|
||||
set(${OUT_VAR} "-PATCH" PARENT_SCOPE)
|
||||
endif()
|
||||
return()
|
||||
elseif(_A_PATCH GREATER _B_PATCH)
|
||||
if(_00fdeadb_PATCH GREATER _ca75feel_PATCH)
|
||||
set(${OUT_VAR} ">PATCH" PARENT_SCOPE)
|
||||
return()
|
||||
elseif(_A_PATCH LESS _B_PATCH)
|
||||
elseif(_00fdeadb_PATCH LESS _ca75feel_PATCH)
|
||||
set(${OUT_VAR} "<PATCH" PARENT_SCOPE)
|
||||
return()
|
||||
elseif((_00fdeadb_PATCH STREQUAL "") OR (_ca75feel_PATCH STREQUAL ""))
|
||||
if(_00fdeadb_PATCH)
|
||||
set(${OUT_VAR} "+PATCH" PARENT_SCOPE)
|
||||
return()
|
||||
elseif(_ca75feel_PATCH)
|
||||
set(${OUT_VAR} "-PATCH" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Tweak
|
||||
if((DEFINED _A_TWEAK OR DEFINED _B_TWEAK) AND ((NOT DEFINED _A_TWEAK) OR (NOT DEFINED _B_TWEAK)))
|
||||
if(DEFINED _A_TWEAK)
|
||||
set(${OUT_VAR} "+TWEAK" PARENT_SCOPE)
|
||||
else()
|
||||
set(${OUT_VAR} "-TWEAK" PARENT_SCOPE)
|
||||
endif()
|
||||
return()
|
||||
elseif(_A_TWEAK GREATER _B_TWEAK)
|
||||
if(_00fdeadb_TWEAK GREATER _ca75feel_TWEAK)
|
||||
set(${OUT_VAR} ">TWEAK" PARENT_SCOPE)
|
||||
return()
|
||||
elseif(_A_TWEAK LESS _B_TWEAK)
|
||||
elseif(_00fdeadb_TWEAK LESS _ca75feel_TWEAK)
|
||||
set(${OUT_VAR} "<TWEAK" PARENT_SCOPE)
|
||||
return()
|
||||
elseif((_00fdeadb_TWEAK STREQUAL "") OR (_ca75feel_TWEAK STREQUAL ""))
|
||||
if(_00fdeadb_TWEAK)
|
||||
set(${OUT_VAR} "+TWEAK" PARENT_SCOPE)
|
||||
return()
|
||||
elseif(_ca75feel_TWEAK)
|
||||
set(${OUT_VAR} "-TWEAK" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Pre-Release
|
||||
if((DEFINED _A_PRERELEASE) AND (DEFINED _B_PRERELEASE) AND (NOT (_A_PRERELEASE STREQUAL _B_PRERELEASE)))
|
||||
set(${OUT_VAR} "PRERELEASE" PARENT_SCOPE)
|
||||
return()
|
||||
elseif((DEFINED _A_PRERELEASE OR DEFINED _B_PRERELEASE) AND ((NOT DEFINED _A_PRERELEASE) OR (NOT DEFINED _B_PRERELEASE)))
|
||||
if(DEFINED _A_PRERELEASE)
|
||||
if((_00fdeadb_PRERELEASE STREQUAL "") OR (_ca75feel_PRERELEASE STREQUAL ""))
|
||||
if(_00fdeadb_PRERELEASE)
|
||||
set(${OUT_VAR} "+PRERELEASE" PARENT_SCOPE)
|
||||
else()
|
||||
return()
|
||||
elseif(_ca75feel_PRERELEASE)
|
||||
set(${OUT_VAR} "-PRERELEASE" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
elseif(NOT (_00fdeadb_PRERELEASE STREQUAL _ca75feel_PRERELEASE))
|
||||
set(${OUT_VAR} "PRERELEASE" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
# Build
|
||||
if((DEFINED _A_BUILD) AND (DEFINED _B_BUILD) AND (NOT (_A_BUILD STREQUAL _B_BUILD)))
|
||||
set(${OUT_VAR} "BUILD" PARENT_SCOPE)
|
||||
return()
|
||||
elseif((DEFINED _A_BUILD OR DEFINED _B_BUILD) AND ((NOT DEFINED _A_BUILD) OR (NOT DEFINED _B_BUILD)))
|
||||
if(DEFINED _A_BUILD)
|
||||
if((_00fdeadb_BUILD STREQUAL "") OR (_ca75feel_BUILD STREQUAL ""))
|
||||
if(_00fdeadb_BUILD)
|
||||
set(${OUT_VAR} "+BUILD" PARENT_SCOPE)
|
||||
else()
|
||||
return()
|
||||
elseif(_ca75feel_BUILD)
|
||||
set(${OUT_VAR} "-BUILD" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
elseif(NOT (_00fdeadb_BUILD STREQUAL _ca75feel_BUILD))
|
||||
set(${OUT_VAR} "BUILD" PARENT_SCOPE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user