<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I think cmake's find_package is only a first order approximation to
premake's usages. What usage library targets have that find_package
doesn't is the ability to cleanly inject dependency info (like
include dirs or link libraries) into any target that claims to be
dependent on the library. This is achieved simply by having the
target call "uses <library>"... there is no need for the
target to explicitly add anything to target_link_libraries() or
include_directories().<br>
<br>
I guess it's a bit like calling include_directories() twice, once in
the CMakeLists.txt for the library and again in the CMakeLists.txt
file for the target using the library, but then you'd need to have
the latter include() the former for it to work (as having target
add_subdirectory(library) wouldn't have the same accumulative
effect). But for accumulating all linker objects together, this
wouldn't work (that is, having target call target_link_libraries()
on its binaries then include()'ing another file defining library
which calls target_link_libraries() for its binaries). Target would
have to either add something via target_link_libraries() or call
add_dependencies(target library).<br>
<br>
I guess the crux of it is that target shouldn't have to concern
itself with library's business. It should be library's job to add
library's header paths to include_directories(), or its binaries to
target_link_libraries(). Target should only add its own header
paths and binaries. It's the whole 'separation of concerns' or
'modular object programming paradigm' argument.<br>
<br>
I guess I'd say usages seem to be like a combination of
include_directories, add_dependencies and target_link_libraries, but
done in a more succinct way and put in their proper place. Apart
from the succinctness, can this be done in CMake?<br>
<br>
<br>
On 16/01/2012 11:54 PM, Yuri Timenkov wrote:
<blockquote
cite="mid:CAJbn1b5bVzJBz-XXcTPFuo=L_ToFLvrq4y=5HbuN=GQcFzfKsg@mail.gmail.com"
type="cite">
<p>if i understand correctly it's CMake's find_package analog.</p>
<p>On Jan 16, 2012 10:41 AM, "Lance Luvaul" <<a
moz-do-not-send="true" href="mailto:lance@mso.anu.edu.au">lance@mso.anu.edu.au</a>>
wrote:<br type="attribution">
</p>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
See <a moz-do-not-send="true"
href="http://sourceforge.net/tracker/index.php?func=detail&aid=2794681&group_id=71616&atid=531880"
target="_blank">http://sourceforge.net/tracker/index.php?func=detail&aid=2794681&group_id=71616&atid=531880</a>
for more detail on what constitutes a usage-target. How can I
achieve the same result in CMake? Thanks.<br>
--<br>
<br>
Powered by <a moz-do-not-send="true"
href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
moz-do-not-send="true"
href="http://www.kitware.com/opensource/opensource.html"
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a
moz-do-not-send="true"
href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a moz-do-not-send="true"
href="http://www.cmake.org/mailman/listinfo/cmake"
target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote>
</blockquote>
</body>
</html>