Draft: build: simplify the CMake code that calculates versions
The CMake code that was calculating versions was quiet complicated: it depended on if the code was run in GitLab CI or not, if a Git tag was defined or not, and if not tag was defined, on the current Git branch.
This commit simplifies this logic:
- The caller of CMake can now provide the variables
ASAPO_VERSION
andASAPO_BUILD_COMMIT
. - If not values are provided, CMake uses Git to calculates these values based on the last Git tag and current commit SHA.
- The values of
ASAPO_VERSION
,ASAPO_VERSION_COMMIT
,PYTHON_ASAPO_VERSION
,ASAPO_DOCKER_DEV_SUFFIX
andASAPO_DOCKER_TAG
are calculated fromASAPO_VERSION
andASAPO_BUILD_COMMIT
. - These values are compared against the corresponding environment variables if defined, which is the case when the code is executed in GitLab CI.