build(cmake): fallback to pkg-config discovery for tomlplusplus
Some distributions of it (like in vcpkg *wink*) won't contain CMake files Signed-off-by: seth <getchoo@tuta.io>
This commit is contained in:
parent
822b10e46e
commit
a5f5d14538
2 changed files with 13 additions and 1 deletions
|
@ -348,6 +348,14 @@ endif()
|
||||||
if(NOT Launcher_FORCE_BUNDLED_LIBS)
|
if(NOT Launcher_FORCE_BUNDLED_LIBS)
|
||||||
# Find toml++
|
# Find toml++
|
||||||
find_package(tomlplusplus 3.2.0 QUIET)
|
find_package(tomlplusplus 3.2.0 QUIET)
|
||||||
|
# Fallback to pkg-config (if available) if CMake files aren't found
|
||||||
|
if(NOT tomlplusplus_FOUND)
|
||||||
|
find_package(PkgConfig)
|
||||||
|
if(PkgConfig_FOUND)
|
||||||
|
pkg_check_modules(tomlplusplus IMPORTED_TARGET tomlplusplus>=3.2.0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Find cmark
|
# Find cmark
|
||||||
find_package(cmark QUIET)
|
find_package(cmark QUIET)
|
||||||
|
|
|
@ -1309,12 +1309,16 @@ target_link_libraries(Launcher_logic
|
||||||
Launcher_murmur2
|
Launcher_murmur2
|
||||||
nbt++
|
nbt++
|
||||||
${ZLIB_LIBRARIES}
|
${ZLIB_LIBRARIES}
|
||||||
tomlplusplus::tomlplusplus
|
|
||||||
qdcss
|
qdcss
|
||||||
BuildConfig
|
BuildConfig
|
||||||
Qt${QT_VERSION_MAJOR}::Widgets
|
Qt${QT_VERSION_MAJOR}::Widgets
|
||||||
qrcodegenerator
|
qrcodegenerator
|
||||||
)
|
)
|
||||||
|
if(TARGET PkgConfig::tomlplusplus)
|
||||||
|
target_link_libraries(Launcher_logic PkgConfig::tomlplusplus)
|
||||||
|
else()
|
||||||
|
target_link_libraries(Launcher_logic tomlplusplus::tomlplusplus)
|
||||||
|
endif()
|
||||||
|
|
||||||
if (UNIX AND NOT CYGWIN AND NOT APPLE)
|
if (UNIX AND NOT CYGWIN AND NOT APPLE)
|
||||||
target_link_libraries(Launcher_logic
|
target_link_libraries(Launcher_logic
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue