Add Termcolor dependency and bundle it in dist/.
This commit is contained in:
parent
b557656649
commit
d3c3062cc0
|
@ -13,6 +13,7 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
# Project build options.
|
# Project build options.
|
||||||
option(WITH_TESTS "Compile tests." NO)
|
option(WITH_TESTS "Compile tests." NO)
|
||||||
|
option(FALLBACK_BUNDLED "Fall back to bundled libs." YES)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
@ -26,6 +27,14 @@ find_package(Gettext REQUIRED)
|
||||||
find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
|
find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
|
||||||
find_package(LibArchive 3.2 REQUIRED)
|
find_package(LibArchive 3.2 REQUIRED)
|
||||||
find_package(fmt 4 REQUIRED CONFIG)
|
find_package(fmt 4 REQUIRED CONFIG)
|
||||||
|
find_package(termcolor CONFIG)
|
||||||
|
if(NOT termcolor_FOUND)
|
||||||
|
if(FALLBACK_BUNDLED)
|
||||||
|
add_subdirectory(dist/termcolor)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Termcolor was not found.")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
:uri-libarchive: https://www.libarchive.org/
|
:uri-libarchive: https://www.libarchive.org/
|
||||||
:uri-fmt: https://github.com/fmtlib/fmt
|
:uri-fmt: https://github.com/fmtlib/fmt
|
||||||
:uri-asciidoc: http://asciidoc.org/
|
:uri-asciidoc: http://asciidoc.org/
|
||||||
|
uri-termcolor: https://termcolor.readthedocs.io/
|
||||||
|
|
||||||
*{project}* is a search tool for EPUB e-books.
|
*{project}* is a search tool for EPUB e-books.
|
||||||
|
|
||||||
|
@ -49,6 +50,7 @@ image::https://repology.org/badge/vertical-allrepos/epubgrep.svg[]
|
||||||
* link:{uri-libarchive}[libarchive] (tested: 3.5 / 3.2)
|
* link:{uri-libarchive}[libarchive] (tested: 3.5 / 3.2)
|
||||||
* link:{uri-fmt}[fmt] (tested: 7.0 / 4.0)
|
* link:{uri-fmt}[fmt] (tested: 7.0 / 4.0)
|
||||||
* link:{uri-asciidoc}[AsciiDoc] (tested: 8.6 / 9.0)
|
* link:{uri-asciidoc}[AsciiDoc] (tested: 8.6 / 9.0)
|
||||||
|
* link:{uri-termcolor}[Termcolor] (tested: 2.0)
|
||||||
* Optional
|
* Optional
|
||||||
** Tests: link:{uri-catch}[Catch] (tested: 2.13 / 1.10)
|
** Tests: link:{uri-catch}[Catch] (tested: 2.13 / 1.10)
|
||||||
|
|
||||||
|
@ -79,5 +81,6 @@ cmake --build . -- --jobs=$(nproc --ignore=1)
|
||||||
* `-DCMAKE_BUILD_TYPE=Debug` for a debug build.
|
* `-DCMAKE_BUILD_TYPE=Debug` for a debug build.
|
||||||
* `-DWITH_TESTS=YES` if you want to compile the tests.
|
* `-DWITH_TESTS=YES` if you want to compile the tests.
|
||||||
* `-DXGETTEXT_CMD=String` The program to use instead of `xgettext`.
|
* `-DXGETTEXT_CMD=String` The program to use instead of `xgettext`.
|
||||||
|
* `-DFALLBACK_BUNDLED=NO if you don't want to fall back on bundled libraries.
|
||||||
|
|
||||||
include::{uri-base}/raw/branch/main/CONTRIBUTING.adoc[]
|
include::{uri-base}/raw/branch/main/CONTRIBUTING.adoc[]
|
||||||
|
|
|
@ -21,7 +21,8 @@ target_link_libraries(${PROJECT_NAME}_lib
|
||||||
Boost::program_options
|
Boost::program_options
|
||||||
Boost::regex
|
Boost::regex
|
||||||
std::filesystem
|
std::filesystem
|
||||||
fmt::fmt)
|
fmt::fmt
|
||||||
|
termcolor::termcolor)
|
||||||
|
|
||||||
if(${CMAKE_VERSION} VERSION_LESS 3.17)
|
if(${CMAKE_VERSION} VERSION_LESS 3.17)
|
||||||
target_link_libraries(${PROJECT_NAME}_lib
|
target_link_libraries(${PROJECT_NAME}_lib
|
||||||
|
|
Loading…
Reference in New Issue