ArthurSonzogni / FTXUI

:computer: C++ Functional Terminal User Interface. :heart:
MIT License
6.64k stars 399 forks source link

CMakeLists.txt issue when git is not installed or master.zip from github is used #62

Closed std-any-emplace closed 3 years ago

std-any-emplace commented 3 years ago

The supplied CMakeLists.txt fails if either git is not installed or the master.zip from github is used (and therefore the unpacked source does not contain a git repository). Change the top to:

find_package(git QUIET)
if (git_FOUND)
  execute_process(
  COMMAND git rev-list --count HEAD
  WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  OUTPUT_VARIABLE git_version
  OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
  set(git_version 0)
endif()

Setting git_version to 0 may not be the best solution, but at least it works.

ArthurSonzogni commented 3 years ago

Thanks! That's right. Do you want to send a pull request?

std-any-emplace commented 3 years ago

TBH c&p is probably less a hassle...

ArthurSonzogni commented 3 years ago

Yeah, I realized I asked someone reporting a bug happening when git isn't installed, to submit a fix using git.

I will do it when I will be back in front of a computer tonight.

Le ven. 20 nov. 2020 à 13:01, std-any-emplace notifications@github.com a écrit :

TBH c&p is probably less a hassle...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ArthurSonzogni/FTXUI/issues/62#issuecomment-731129064, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEJ4QU5V4QIOWFSSSXTZ3LSQZLAZANCNFSM4T4PVLEQ .

ArthurSonzogni commented 3 years ago

Done. Thanks!