1
0
mirror of https://github.com/altlinux/admc.git synced 2025-02-13 17:57:25 +03:00

fix version in cmake

has to be manually defined, now that there's no .spec
This commit is contained in:
Dmitry Degtyarev 2021-08-03 15:48:41 +04:00
parent a27a79fa06
commit 87d3b0617f

View File

@ -7,20 +7,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_compile_options(-Wall -Wshadow -Werror=switch)
# You can get version from spec by first finding Versions keyword.
# After that you can use awk to split line by : and then select second part of it.
# Finally you want to clear all the spaces around version.
# OUTPUT_VARIABLE argument of execute_process allows you to capture output of the command.
execute_process(
COMMAND
bash -c "grep Version: .gear/admc.spec | awk -F\":\" '{ print $2 }' | tr -d [:space:]"
OUTPUT_VARIABLE GEAR_VERSION
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
project(admc VERSION 0.6.3)
# To ensure that we have indeed captured the project version we use message to provide us with console output.
message(STATUS "Project version is: " ${GEAR_VERSION})
project(admc VERSION ${GEAR_VERSION})
message(STATUS "Project version is: " ${VERSION})
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}