如何在CMakeLists.txt中添加外部目录?

时间:2018-07-11 09:54:00

标签: android cmake

以下是我的 android / CMakeLists.txt

add_subdirectory("thirdparty/jpeg")

include_directories("thirdparty/jpeg/src")

add_library(readJpeg SHARED "trng-library/src/main/cpp/jpegread.c")

find_library(
          log-lib
          log )

target_link_libraries(
                   readJpeg
                   ${log-lib}
                    jpeg)

和我之前的项目结构:

enter image description here

以上工作正常。

现在,我将第三方移动到 android 的同一目录:

enter image description here

如何更改我的 android / CMakeLists.txt ?因为在我添加../来更改路径后会发生错误:

add_subdirectory("../thirdparty/jpeg")

include_directories("../thirdparty/jpeg/src")

add_library(readJpeg SHARED "trng-library/src/main/cpp/jpegread.c")

find_library(
          log-lib
          log )

target_link_libraries(
                   readJpeg
                   ${log-lib}
                    jpeg)
  

CMakeLists.txt:9(add_subdirectory)的CMake错误:
  -配置不完整,发生错误!

0 个答案:

没有答案