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_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}LangShared${CMAKE_SHARED_LIBRARY_SUFFIX}
for that (LIBRARY_OUTPUT_PATH
is defined in my CMakeLists.txt
). This looks like hard-coding to me, because it will break as soon as the target is renamed or some of its properties are changed. Is there a way to get an absolute path to add_library
's output?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…