On 08/29/2014 05:26 AM, Nils Gladitz wrote: > I tried wrapping the libraries returned by FindBoost.cmake in > $<BUILD_INTERFACE> in a target_link_libraries() call and noticed that > this breaks because of the debug/optimized keywords that the find module > inserts. > > Specifically it results in CMake trying to link e.g. "optimized.lib". > > Should/could these keywords be handled at generation time (after > generator expressions expansion)?
These keywords are meaningful to target_link_libraries and nothing else, just like the PRIVATE/PUBLIC/INTERFACE keywords. It is the responsibility of that command to handle them. One can put a genex in the value after the keyword: "optimized $<...>", but otherwise they are not really meant to mix. The use of generator expressions and imported targets is supposed to supersede use of the old keywords. There was recent work posted on this list to add imported targets to the FindBoost results. > There don't seem to be generator expressions that correspond to the > debug/optimized keywords exactly. Can/should there be? Steve K and I discussed this once. Since DEBUG_CONFIGURATIONS can be set differently in exporting and importing projects so there is no global meaning across all targets. See the cmTarget::GetDebugGeneratorExpressions method: http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmTarget.cxx;hb=v3.0.1#l908 It constructs a $<OR:...> expression of $<CONFIG:...> expressions for each entry in DEBUG_CONFIGURATIONS. This is how target_link_libraries transforms debug/optimized keywords when constructing the INTERFACE_LINK_LIBRARIES value. -Brad -- 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: http://public.kitware.com/mailman/listinfo/cmake-developers