<div dir="ltr">There's a TYPE property which should contain what you need: <a href="https://cmake.org/cmake/help/latest/prop_tgt/TYPE.html">https://cmake.org/cmake/help/latest/prop_tgt/TYPE.html</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 29, 2015 at 4:53 PM, Attila Krasznahorkay <span dir="ltr"><<a href="mailto:attila.krasznahorkay@gmail.com" target="_blank">attila.krasznahorkay@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear All,<br>
<br>
In my code I'm trying to do something slightly tricky. I include packages that provide imported libraries (amongst other things). Then, because of how my project is structured, I don't make use of the imported libraries directly, but first make "copies" of them, and then make use of these copies in my build.<br>
<br>
(The reason is that I allow the project to override libraries that are available from the base packages as well. In which case components using this overridden library need to use this instance instead of the imported one. But if no such override is in place, I need to give the library a name that the components in the project expect to find it with.)<br>
<br>
If there would be a way in CMake to "clone" an imported library with a new name, that would be perfect for my use case. Since as far as I know there's no such thing, I use code like:<br>
<br>
      ...<br>
      add_library( ${libName} SHARED IMPORTED GLOBAL )<br>
      # Check which builds it is available for:<br>
      get_property( _builds TARGET ${prefix}_${libName}<br>
         PROPERTY IMPORTED_CONFIGURATIONS )<br>
      set_property( TARGET ${libName} PROPERTY<br>
         IMPORTED_CONFIGURATIONS ${_builds} )<br>
      ...<br>
<br>
Now, I recently started producing MODULE and INTERFACE libraries as well. So the first line in this code is no longer correct for all the imported libraries. Plus, for INTERFACE libraries the get_property call on IMPORTED_CONFIGURATIONS just fails with an error message.<br>
<br>
So now I wonder: Is there a target property on INTERFACE libraries that I could use to identify them? Like how there is the target property IMPORTED on the imported libraries.<br>
<br>
Cheers,<br>
            Attila<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>