Better cmake curl finding
This commit is contained in:
parent
308b77f2c4
commit
25819c346a
1 changed files with 5 additions and 9 deletions
|
@ -4,16 +4,12 @@ cmake_minimum_required(VERSION 3.24)
|
|||
project(matrix-3ds-sdk)
|
||||
|
||||
add_subdirectory(olm)
|
||||
add_library(matrix-3ds-sdk source/matrixclient.cpp source/memorystore.cpp source/util.cpp)
|
||||
add_library(matrix-3ds-sdk source/matrixclient.cpp source/memorystore.cpp source/util.cpp
|
||||
source/devicestore.cpp
|
||||
source/devicestore.h)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(jansson REQUIRED IMPORTED_TARGET jansson)
|
||||
pkg_check_modules(libcurl REQUIRED IMPORTED_TARGET libcurl)
|
||||
|
||||
# libtool usage forcing this little hack
|
||||
file(READ "${DEVKITPRO}/portlibs/3ds/lib/libcurl.la" contents)
|
||||
if (contents MATCHES "dependency_libs *= *'([^']*)'")
|
||||
string(STRIP "${CMAKE_MATCH_1}" deps)
|
||||
string(REGEX REPLACE " +" ";" deps "${deps}")
|
||||
target_link_libraries(matrix-3ds-sdk PRIVATE curl PkgConfig::jansson olm ${deps})
|
||||
endif()
|
||||
|
||||
target_link_libraries(matrix-3ds-sdk PRIVATE PkgConfig::libcurl PkgConfig::jansson olm ${deps})
|
||||
target_include_directories(matrix-3ds-sdk PUBLIC source include "${DEVKITPRO}/portlibs/3ds/include/")
|
||||
|
|
Loading…
Reference in a new issue