CMake: Prefer Config, make Termcolor-message more visible.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Starting with Boost 1.70, it provides an official CMake Package Config. Prefer that if it is available. Gets rid of the “New Boost version may have incorrect or missing dependencies and imported targets” warnings.
This commit is contained in:
parent
6a612caa14
commit
10396f0d81
|
@ -23,6 +23,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
include(cmake/debug_flags.cmake)
|
include(cmake/debug_flags.cmake)
|
||||||
|
|
||||||
# All dependencies except test dependencies.
|
# All dependencies except test dependencies.
|
||||||
|
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
|
||||||
find_package(Boost 1.65.0 REQUIRED COMPONENTS locale program_options regex)
|
find_package(Boost 1.65.0 REQUIRED COMPONENTS locale program_options regex)
|
||||||
find_package(Gettext REQUIRED)
|
find_package(Gettext REQUIRED)
|
||||||
find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
|
find_package(Filesystem REQUIRED COMPONENTS Final Experimental)
|
||||||
|
@ -31,7 +32,7 @@ find_package(fmt 4 REQUIRED CONFIG)
|
||||||
find_package(termcolor CONFIG)
|
find_package(termcolor CONFIG)
|
||||||
if(NOT termcolor_FOUND)
|
if(NOT termcolor_FOUND)
|
||||||
if(FALLBACK_BUNDLED)
|
if(FALLBACK_BUNDLED)
|
||||||
message(VERBOSE "Using bundled version of Termcolor.")
|
message(STATUS "Using bundled version of Termcolor.")
|
||||||
add_subdirectory(dist/termcolor EXCLUDE_FROM_ALL)
|
add_subdirectory(dist/termcolor EXCLUDE_FROM_ALL)
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Termcolor was not found.")
|
message(FATAL_ERROR "Termcolor was not found.")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user