I want to import a prebuilt library using this CmakeLists.txt snippet:
add_library(openssl-crypto
SHARED
IMPORTED )
set_target_proper
You can use set_property function with attribute TARGET instead of set_target_properties, and then you can set path relatively using macros ${PROJECT_SOURCE_DIR}.
# import shared library libmylib.so
add_library( my-imported-lib
SHARED
IMPORTED)
# set the path to appropriate so files with appropriate architectures
set_property(TARGET
my-imported-lib
PROPERTY IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}//${ANDROID_ABI}/libmy-imported-lib.so)
...
# link imported library to your developed library
target_link_libraries( my-developed-lib
my-imported-lib )
Maybe you can use macros ${PROJECT_SOURCE_DIR} while set lib path with set_target_properties but I didn't check this way.