James C. Sutherland wrote: > Thanks. To be clear, it only works if I use > > set( ExprLib_LIBRARIES @TPL_LIBRARIES@ ) > > because otherwise I have no way of propagating the dependents of > ExprLib downstream. It is true that CMake will add the ExprLib > library as a "target" that can be used internally in downstream > projects, but the other third-party libraries that ExprLib > requires can only be propagated "manually" - right?
In this example: # Library add_library(foo foo.c) target_link_libraries(foo m) install(TARGETS foo DESTINATION lib EXPORT FooLib) install(EXPORT FooLib DESTINATION lib/FooLib) the FooLib.cmake file will provide the dependency on 'm'. In an application: # App include(.../lib/FooLib/FooLib.cmake) add_executable(bar bar.c) target_link_libraries(bar foo) The link line for 'bar' will contain -o bar ... /path/to/lib/libfoo.a -lm ... -Brad _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
