Zitat von Mats Kindahl <m...@sun.com>:
Ideally, I would like to copy or build the libraries in a central "lib/"
directory similar to how I copy all the include files to the "include/"
directory, but how is that supported by CMake?

See
http://www.cmake.org/cmake/help/cmake2.6docs.html#variable:CMAKE_LIBRARY_OUTPUT_DIRECTORY


Or you use the INSTALL() directives to add the install target that you
can use to install the files into a wanted directory structure.

Well... in this case, the libraries are only temporary and used during the build of the final target.

So they are static libs? Then that doesn't matter.

So, basically, each package can depend on a number of include files and
libraries that have not yet been built, so somehow I need to specify
 rules for how to build it all in a good order.

Using target_link_libraries() already does this _if_ you defined the
library with add_library() _before_ using target_link_libraries. You
GLOB will apply alphabetic order. Don't use it if you need a specific
order. Use an explicit list instead.

Well... in this case, I don't know the subdirectories that will be used, nor the dependencies.

So you want to build something that you have no information about?

Only the subsystems know what dependencies they have on other items, so
therefore I would like to place the dependencies inside the packages, and the
dependencies are on specific library files and header that are made available
for other packages.

I was somehow hoping that CMake would resolve the dependencies, as long as they are provided, and create a proper build order for all the
subsystems (assuming, of course, that the dependencies form a DAG).

But the add_library() and add_executable() calls but be in proper order to do so. The rest in done with target_link_library().

The problem is that target_link_library() takes both, library target names, full path to library files or base names of installed libraries. The first two are linked with full path, the latter is used with e.g. -lio.
Having 'io' as target is not enforced :-/
This implies the proper order of the add_*() calls.

You can do that with variables (like done with C/C++ header guards) and reference the libraries CMakeLists.txt files before using the targets declared there.

HS



_______________________________________________
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