mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-10-30 16:07:38 +08:00
Fix CMake when git is not found. (#64)
Fix: https://github.com/ArthurSonzogni/FTXUI/issues/62
This commit is contained in:
parent
afd53e0508
commit
977f13967f
@ -1,11 +1,17 @@
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-list --count HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE git_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
find_package(Git QUIET)
|
||||
if (Git_FOUND)
|
||||
message("git found")
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE git_version
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
else()
|
||||
set(git_version 0)
|
||||
endif()
|
||||
|
||||
project(ftxui
|
||||
LANGUAGES CXX
|
||||
|
Loading…
Reference in New Issue
Block a user