7

I keep getting a

ninja: error: '/root/code/CalcLib/libCalcLibAndroidx86.a', needed by '/root/code/compcorpsdk/build/intermediates/cmake/prod/release/obj/x86/libJumboFFT.so', missing and no known rule to make it

Although I checked both directories with the correct files exist and I believe I have the include-directories paths set up correctly in the CmakeList.txt.

CMakeLists.txt

cmake_minimum_required(VERSION 3.4.1)

set(
P1 "/root/code/CalcLib"
CACHE STRING ""
)

message(${ANDROID_ABI})

file(GLOB CPP_FILES "*.cpp")

add_library(
JumboFFT
SHARED
${CPP_FILES}
)

include_directories(src/main/jni)
include_directories(${P1})

target_link_libraries(
JumboFFT
log
android
OpenSLES
${P1}/libCalcLibAndroid${ANDROID_ABI}.a
)

Gradle Assemble output Gradle Asemble output text

Zoe
  • 27,060
  • 21
  • 118
  • 148
Jada
  • 345
  • 2
  • 5
  • 12

2 Answers2

2
set_target_properties 

in cmake does not like relative paths

see here: cmake:missing and no known rule to make it when I import a prebuilt library

Droid Teahouse
  • 893
  • 8
  • 15
0

I believe you should add it first as a library using add_library and set_target_properties and then link it as such:

...

add_library(libCalcLibAndroid STATIC IMPORTED)
set_target_properties(libCalcLibAndroid PROPERTIES
  IMPORTED_LINK_INTERFACE_LIBRARIES ""
  IMPORTED_LOCATION "${P1}/libCalcLibAndroid${ANDROID_ABI}.a"
)

target_link_libraries(
JumboFFT
log
android
OpenSLES
libCalcLibAndroid
)
ahasbini
  • 6,761
  • 2
  • 29
  • 45