James C. Sutherland wrote:
The library I am building pulls in several other libraries (MPI, BLAS, Boost, etc). I would like any down-stream apps that use my library to automatically be able to include any appropriate header files and link to appropriate third-party libraries that were included in my library.

Ah, I see the difference.  I was thinking about link dependencies of
libraries that you build.  You were talking about package-level deps.

I have the following in my Config file:

--------------- <snip> ---------------
set( ExprLib_FOUND 1 )

This is not necessary.  The find_package command automatically sets
this when it locates the config file.

set( ExprLib_INCLUDE_DIR @ExprLib_INCLUDE@ )

set( ExprLib_TPL_INCLUDE_DIRS @TPL_INCLUDE_DIRS@ )

This looks fine.  Currently we have no builtin way to express
usage requirements.  Automatic dependency propagation only works
for linking.

include( @CMAKE_INSTALL_PREFIX@/lib/expression/ExprLib.cmake )

Is ExprLib.cmake produced bin install(EXPORT)?

set( ExprLib_LIBRARIES
   @CMAKE_INSTALL_PREFIX@/lib/expression/@ExprInstallLib@
   @TPL_LIBRARIES@
   )

This should not be needed.  Applications that did

  find_package(ExprLib)

should be able to do

  target_link_libraries(myapp ExprLib)

and get all the dependencies automatically.  The install(EXPORT)
command should have put the necessary information in ExprLib.cmake
(or one of the files it includes).  It defines an IMPORTED target
called "ExprLib" and sets properties that tell CMake how to link
to it.

-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

Reply via email to