我查看了对 cmake 使用 add_custom_command 的响应,但无法让它在 android studio 中工作。运行时找不到目标。
add_custom_command( TARGET b.c.o
POST_BUILD
file(RENAME ${CMAKE_HOME_DIRECTORY}/newfolder/customer.txt ${CMAKE_HOME_DIRECTORY}/newfolder/used_customer.txt)
)
我得到以下信息:
CMake Error at CMakeLists.txt:73 (add_custom_command):
No TARGET ')' has been created in this directory.
-- Configuring incomplete, errors occurred!
See also "C:/Documents/Android_files/local_app/BApp/.externalNativeBuild/cmake/debug/x86_64/CMakeFiles/CMakeOutput.log".
FAILURE:构建失败并出现异常。
什么地方出了错:
A problem occurred configuring project ':BApp'.
> executing external native build for cmake C:\Documents\Android_files\local_app\BApp\CMakeLists.txt
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
在https://help.gradle.org获得更多帮助
32 秒内构建失败
每次运行时似乎都找不到目标文件。你能在这件事上提供一些帮助吗?