gpt4 book ai didi

安卓NDK : CMAKE how to move IMPORTED shared library to libs folder

转载 作者:行者123 更新时间:2023-11-29 00:56:32 25 4
gpt4 key购买 nike

我有一个构建 libMyProject1.so 的 Android NDK 项目,我正在使用:

set_target_properties(MyProject1
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../Client/libs/${ANDROID_ABI}")

将构建的库导出到我需要的文件夹。

我还有另一个链接的外部共享库:

我的外部图书馆

add_library(MyExternal SHARED IMPORTED)
set_target_properties(MyExternal PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/../MyExternal/libs/${ANDROID_ABI}/libMyExternal.so)

target_link_libraries( # Specifies the target library.
MyProject1
# Shared Dependencies
MyExternal
# Links the target library to the log library
# included in the NDK.
${log-lib})

libMyProject1.so 被复制到 Client/libs/${ANDROID_ABI}libMyExternal.so 没有被复制。如何使用 cmake 将外部共享库复制到我的客户端文件夹?

最佳答案

正如评论中所建议的,以下对我有用:

file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../MyExternal/libs/${ANDROID_ABI}/libMyExternal.so
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/../Client/libs/${ANDROID_ABI})

关于安卓NDK : CMAKE how to move IMPORTED shared library to libs folder,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54354021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com