Hi All,

I'm trying to debug an issues where an imported shared library is showing
up in the linker command as not found, but within the CMake generation the
target seems to exist.

# CMakeLists.txt ####################

include(bar.cmake)

add_library(foo SHARED)

if(TARGET bar)
  target_link_libraries(foo PUBLIC bar)
endif()

# bar.cmake #######################

add_library(bar SHARED IMPORTED)

...


On Linux, the link command contains the correct *-L<bar path>* and *-lbar*
options. However, on Windows (Visual Studio) the linker command has
"bar-NOTFOUND" instead of bar.lib as it should, even though bar should only
be added as a dependency *if* it exists.

How can I debug why this would happen? Is there a way to have CMake dump
more information about that target?

Thanks!
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

Reply via email to