ArthurSonzogni / FTXUI

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

Introductory example fails to build #812

Closed agvxov closed 7 months ago

agvxov commented 7 months ago

In the title I'm referring to the example at the top of this page: https://arthursonzogni.github.io/FTXUI/

Here is the output of the relevant shell session: fxtui.log

This just the error message ripped from the above file:

$ cmake ..
[ 11%] Creating directories for 'ftxui-populate'
[ 22%] Performing download step (git clone) for 'ftxui-populate'
Cloning into 'ftxui-src'...
fatal: invalid reference: master
CMake Error at ftxui-subbuild/ftxui-populate-prefix/tmp/ftxui-populate-gitclone.cmake:49 (message):
  Failed to checkout tag: 'master'

gmake[2]: *** [CMakeFiles/ftxui-populate.dir/build.make:99: ftxui-populate-prefix/src/ftxui-populate-stamp/ftxui-populate-download] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/ftxui-populate.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2

CMake Error at /usr/share/cmake/Modules/FetchContent.cmake:1679 (message):
  Build step for ftxui failed: 2
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FetchContent.cmake:1819:EVAL:2 (__FetchContent_directPopulate)
  /usr/share/cmake/Modules/FetchContent.cmake:1819 (cmake_language)
  CMakeLists.txt:14 (FetchContent_Populate)

-- Configuring incomplete, errors occurred!

I don't know much about CMake, however I believe I have not diverted from the tutorial. Any advice would be appreciated.

esongh commented 7 months ago

You may need to specify the GIT_TAG in FetchContent_Declare in the CMakeLists.txt

set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
FetchContent_Declare(ftxui
  GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
  # Important: Specify a GIT_TAG XXXXX here.
  GIT_TAG v5.0.0
)
ArthurSonzogni commented 7 months ago

@esongh replies is correct.

I will update the doc so that you folks can do a straight copy-paste.