Cmake Ninja error android. "missing and no known rule to make it" although file exists

Jada picture Jada · Mar 14, 2018 · Viewed 13.4k times · Source

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

Answer

Droid Teahouse picture Droid Teahouse · Jul 5, 2018
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