FIND_LIBRARY() ignores library's OUTPUT_NAME
Due to naming conflict, I am adding a prefix to all the PCL libraries (http://pointclouds.org/). I am doing this via setting the property OUTPUT_NAME (https://cmake.org/cmake/help/v3.0/command/set_target_properties.html). Here's an example:
PCL_ADD_LIBRARY("${LIB_NAME}" "${SUBSYS_NAME}" ${srcs})
SET_TARGET_PROPERTIES("${LIB_NAME}" PROPERTIES OUTPUT_NAME "ii3d_${LIB_NAME}")
Note that PCL_ADD_LIBRARY() macro uses ADD_LIBRARY() within it.
Above is working well. Instead of creating pcl_common_release.lib and pcl_common_release.dll, it is creating ii3d_pcl_common_release.lib and ii3d_pcl_common_release.dll. This is what I want.
The problem comes when another library wants to use the above libraries. Currently PCLConfig.cmake has
find_library(PCL_${COMPONENT}_LIBRARY ${pcl_component}${PCL_RELEASE_SUFFIX}
HINTS ${PCL_LIBRARY_DIRS}
DOC "path to ${pcl_component} library"
NO_DEFAULT_PATH)
It is returning the absolute path of the library without the "ii3d_" prefix. This file doesn't even exist. As an example, it is returning E:/libs/pcl/builds/win64-shared-release-cl-qt/lib/pcl_common_release.lib. It should be returning E:/libs/pcl/builds/win64-shared-release-cl-qt/lib/**ii3d_**pcl_common_release.lib instead.
I even tried adding "ii3d_" prefix inside FIND_LIBRARY() as shown below:
find_library(PCL_${COMPONENT}_LIBRARY
"ii3d_${pcl_component}${PCL_RELEASE_SUFFIX}"
HINTS ${PCL_LIBRARY_DIRS}
DOC "path to ${pcl_component} library"
NO_DEFAULT_PATH)
But even this returns the absolute path of the library without the prefix "ii3d_".
Am I doing something wrong here?