help needed with target_link_libraries and INTERFACE_INCLUDE_DIRECTORIES

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

help needed with target_link_libraries and INTERFACE_INCLUDE_DIRECTORIES

guymac
I am at my wit's end after 3 days struggling with this problem.

I export a package with several targets. Those targets are in subdirectories (not sure if that matters). The exported config uses a namespace. In the generated file xyz-config.cmake, I see the following:

# Create imported target xyz::ABC
add_library(xyz::ABC SHARED IMPORTED)

set_target_properties(xyz::ABC  PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "C:/Users/myself/source/repos/xyz"
  INTERFACE_LINK_LIBRARIES "xyz::Strings;xyz::Utility"
)

And that all looks fine. Now, in a project that depends on xyz::ABC I use find_package (which seems to work fine) and target_link_libraries(libTarget xyz::ABC other::Something++).

However, the build process never emits the -I include statement for xyz::ABC, though it does for other::Something++. This is on MSVC17 btw.

Please help, I have tried everything I can think of.

--

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 | Threaded
Open this post in threaded view
|

Re: help needed with target_link_libraries and INTERFACE_INCLUDE_DIRECTORIES

guymac
Ok, I eventually figured it out. I was under the impression that the User
Package Registry did something reasonable, like the build hash was a
function of the OS/version/build type. But it's not; I don't know what it
is. Hence, you can have multiple entries for a project in there, and they
may not have the definitions you'd expect if your project is under
development.



--
Sent from: http://cmake.3232098.n2.nabble.com/
--

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