cmake: extract lsyncd version from lsyncd.lua

This commit is contained in:
Daniel Poelzleithner 2022-10-31 14:36:39 +01:00
parent e371078222
commit 7604dd0e16
1 changed files with 7 additions and 1 deletions

View File

@ -1,7 +1,13 @@
# preamble
project( Lsyncd )
cmake_minimum_required( VERSION 3.5 )
set( LSYNCD_VERSION 2.3.0 )
# extract version
file(STRINGS "lsyncd.lua" LSYNCD_VERSION_RAW REGEX "lsyncd_version = '.*'")
string(REGEX REPLACE "lsyncd_version = \'(.*)\'"
"\\1" LSYNCD_VERSION
${LSYNCD_VERSION_RAW})
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/" )