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:
${PROJECT_SOURCE_DIR}
is the directory where the main CMakeList.txt file resides. That's typically app/src/main/cpp. You can work out the correct relative path now.
This means that you can simply write
include_directories( ${PROJECT_SOURCE_DIR}/../jniLibs/live555/include )
add_library( live555 SHARED IMPORTED )
set_target_properties( live555 PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/../jniLibs/live555/lib/${ANDROID_ABI}/live555.so)