mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-26 12:37:06 +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)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
|
||||||
execute_process(
|
find_package(Git QUIET)
|
||||||
COMMAND git rev-list --count HEAD
|
if (Git_FOUND)
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
message("git found")
|
||||||
OUTPUT_VARIABLE git_version
|
execute_process(
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
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
|
project(ftxui
|
||||||
LANGUAGES CXX
|
LANGUAGES CXX
|
||||||
|
Loading…
Reference in New Issue
Block a user