<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hello everyone,<br><br>I have a design problem. I have a new project consisting on different packages. Each package should be built as a library but it could depend on libraries generated by other packages. Also there is an executable built from some of these libraries:<br><br>root/<br>&nbsp; CMakeLists.txt&nbsp;&nbsp; -&gt; generates executable with some package libraries<br>&nbsp; package1/<br>&nbsp;&nbsp;&nbsp; CMakeLists.txt -&gt; generates package1.lib<br>&nbsp; package2/<br>&nbsp;&nbsp;&nbsp; CMakeLists.txt -&gt; generates package2.lib that depends on package1 library and its header files. so it must include root/package1/<br><br><br>My problem begins with INCLUDE_DIRECTORIES and LINK_DIRECTORIES. I would like that packages include those directories that are really needed to search for headers and libraries, in the previous example package2 should includes directory package 1 so it could find package1's headers, but package1 shouldn't know about package2. To archive this, I think I need to use ADD_SUBDIRECTORY so each sub directory has its own includes and libraries directories. The problem is that the root CMakeLists.txt should known the list of generated libraries and source files so it could make the global executable. <br>I don't find the way to pass this information from package's CMakeLists.txt to the root CMakeLists.txt.<br><br>Do you have some idea?<br>Regards,<br><br>Martin<br><br /><hr />¡Es hora que descubras quién sos! <a href='http://www.descubrewindowslive.com/' target='_new'>Alguien puede conocerte mejor que vos mismo.</a></body>
</html>