1
0
Fork 0

Find and use packaged version of expected header-only library.

Enabled by default when `DESKTOP_APP_USE_PACKAGED` is used. Can be
overriden by `-DDESKTOP_APP_USE_PACKAGED_EXPECTED:BOOL=OFF`.

Signed-off-by: Vitaly Zaitsev <vitaly@easycoding.org>
This commit is contained in:
Vitaly Zaitsev 2020-02-04 09:02:19 +01:00 committed by John Preston
parent ce65c2369e
commit 7b5d3e01c0
3 changed files with 22 additions and 8 deletions

View file

@ -7,7 +7,12 @@
add_library(external_expected INTERFACE IMPORTED GLOBAL) add_library(external_expected INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_expected ALIAS external_expected) add_library(desktop-app::external_expected ALIAS external_expected)
target_include_directories(external_expected SYSTEM if (DESKTOP_APP_USE_PACKAGED_EXPECTED)
INTERFACE find_package(tl-expected CONFIG REQUIRED)
${third_party_loc}/expected/include target_link_libraries(external_expected INTERFACE tl::expected)
) else()
target_include_directories(external_expected SYSTEM
INTERFACE
${third_party_loc}/expected/include
)
endif()

View file

@ -7,7 +7,14 @@
add_library(external_variant INTERFACE IMPORTED GLOBAL) add_library(external_variant INTERFACE IMPORTED GLOBAL)
add_library(desktop-app::external_variant ALIAS external_variant) add_library(desktop-app::external_variant ALIAS external_variant)
target_include_directories(external_variant SYSTEM if (DESKTOP_APP_USE_PACKAGED_VARIANT)
INTERFACE find_path(VARIANT_INCLUDE_DIRS mapbox/variant.hpp)
${third_party_loc}/variant/include if (NOT VARIANT_INCLUDE_DIRS)
) message(FATAL_ERROR "Packaged version of mapbox-variant library not found!")
endif()
else()
target_include_directories(external_variant SYSTEM
INTERFACE
${third_party_loc}/variant/include
)
endif()

View file

@ -23,6 +23,8 @@ endif()
option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${DESKTOP_APP_USE_PACKAGED}) option(DESKTOP_APP_DISABLE_CRASH_REPORTS "Disable crash report generation." ${DESKTOP_APP_USE_PACKAGED})
option(DESKTOP_APP_USE_PACKAGED_RLOTTIE "Find rlottie using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED}) option(DESKTOP_APP_USE_PACKAGED_RLOTTIE "Find rlottie using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
option(DESKTOP_APP_USE_PACKAGED_EXPECTED "Find expected using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
option(DESKTOP_APP_USE_PACKAGED_VARIANT "Find mapbox-variant using CMake instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled one." ${DESKTOP_APP_USE_PACKAGED}) option(DESKTOP_APP_USE_PACKAGED_FONTS "Use preinstalled fonts instead of bundled one." ${DESKTOP_APP_USE_PACKAGED})
option(DESKTOP_APP_ENABLE_IPO_OPTIMIZATIONS "Enable IPO build optimizations." OFF) option(DESKTOP_APP_ENABLE_IPO_OPTIMIZATIONS "Enable IPO build optimizations." OFF)