Unverified Commit 564d0d79 authored by tastytea's avatar tastytea

Extract version from configure.ac and set it for cmake project.

parent d42f22cd
cmake_minimum_required(VERSION 3.1)
project(libconfig LANGUAGES C CXX)
# Extract version from configure.ac.
set(VERSION_REGEX "^AC_INIT\\(libconfig,[ \t]+([0-9\.]+),.*")
file(STRINGS "configure.ac"
VERSION_STRING REGEX ${VERSION_REGEX})
string(REGEX REPLACE ${VERSION_REGEX} "\\1" VERSION_STRING "${VERSION_STRING}")
project(libconfig LANGUAGES C CXX VERSION ${VERSION_STRING})
option(BUILD_EXAMPLES "Enable examples" ON)
option(BUILD_SHARED_LIBS "Enable shared library" ON)
option(BUILD_TESTS "Enable tests" ON)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment