I am trying to link live555.so and .h files with an Android project using cMake. If i don't use absolute path i'm getting error.
My cMake file:
cmake_minimum_required(VERSION 3.4.1) include_directories( ${PROJECT_SOURCE_DIR}/src/main/jniLibs/live555/include ) add_library( live555 SHARED IMPORTED ) set_target_properties( live555 PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/src/main/jniLibs/live555/lib/${ANDROID_ABI}/live555.so) add_library( # Sets the name of the library. native-lib # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). src/main/cpp/native-lib.cpp ) find_library( # Sets the name of the path variable. log-lib # Specifies the name of the NDK library that # you want CMake to locate. log ) target_link_libraries( # Specifies the target library. native-lib android live555 ${log-lib} ) And error:
Error:error: '../../../../src/main/jniLibs/live555/lib/armeabi-v7a/live555.so', needed by '../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libnative-lib.so', missing and no known rule to make it
src/main/jniLibs/live555/lib/armeabi-v7adirectory?message(STATUS ${PROJECT_SRC_DIR})before set_target_propeties, then try to get the property after set to check it : stackoverflow.com/questions/24881408/…