Skip to content

Commit

Permalink
build: support preinstalled ftxui and fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaDucak committed Jun 7, 2024
1 parent 8a1e1e0 commit fd7e9db
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

include(FetchContent)
set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)

# -------------------------- Fetech ftxui ------------------------------- #

set(FETCHCONTENT_UPDATES_DISCONNECTED TRUE)
FetchContent_Declare(
ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v5.0.0)
FetchContent_GetProperties(ftxui)
if(NOT ftxui_POPULATED)
FetchContent_Populate(ftxui)
add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
find_package(ftxui 5)
if(NOT ftxui_FOUND)
message(STATUS "ftxui Not found... fetching")
FetchContent_Declare(
ftxui
GIT_REPOSITORY https://github.com/ArthurSonzogni/ftxui
GIT_TAG v5.0.0)
FetchContent_GetProperties(ftxui)
if(NOT ftxui_POPULATED)
FetchContent_Populate(ftxui)
add_subdirectory(${ftxui_SOURCE_DIR} ${ftxui_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif()

# --------------------------------- boost -------------------------------- #
Expand All @@ -62,14 +66,18 @@ find_package(LibGit2 3 REQUIRED)

# ------------------------------- Fetch FMT ------------------------------ #

FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG 9.1.0)
FetchContent_GetProperties(fmt)
if(NOT fmt_POPULATED)
FetchContent_Populate(fmt)
add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR} EXCLUDE_FROM_ALL)
find_package(fmt 9)
if(NOT fmt_FOUND)
message(STATUS "fmt Not found... fetching")
FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG 9.1.0)
FetchContent_GetProperties(fmt)
if(NOT fmt_POPULATED)
FetchContent_Populate(fmt)
add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endif()

# --------------------------------- tests -------------------------------- #
Expand Down

0 comments on commit fd7e9db

Please sign in to comment.