diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ee2fded..a833b85 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,18 @@ cmake_minimum_required(VERSION 3.15) project(spm C) include(CheckSymbolExists) +find_package(Git) set(CMAKE_C_STANDARD 99) - +execute_process( + COMMAND ${GIT_EXECUTABLE} describe --always --tags --dirty + OUTPUT_VARIABLE VERSION + ERROR_VARIABLE VERSION_ERROR + OUTPUT_STRIP_TRAILING_WHITESPACE +) +if(${VERSION_ERROR}) + message("Git required to build this software") + return(1) +endif(${VERSION_ERROR}) check_symbol_exists(strsep string.h HAVE_STRSEP) configure_file(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/include/config.h) |