I have a .so library target created by add_library, and need to pass an absolute path to this library to an external script. Now I have ${LIBRARY_OUTPUT_P
To expand on the answer by @bgooddr, here is a CMake function to get the location of a target:
function(get_fancy_lib_location)
set(options)
set(multiValueArgs LIB)
set(oneValueArgs LOCATION)
cmake_parse_arguments(get_fancy_lib_location "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
message (STATUS "fancy_lib == ${get_fancy_lib_location_LIB}")
get_property(fancy_lib_location TARGET "${get_fancy_lib_location_LIB}" PROPERTY LOCATION)
message (STATUS "fancy_lib_location == ${fancy_lib_location}")
set(${get_fancy_lib_location_LOCATION} ${fancy_lib_location})
endfunction()