<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">I thank you so much Eric,<br>However I managed this thing and obteined the expected result by writing something similar and then including it in my root CMakeLists.txt:<br><br>----- util lib dependency -----<br># -*- Makefile -*-<br><br>IF(BUILD_STANDALONE)<br><br>&nbsp; project( util_lib_pro )<br><br># compatibility issues<br>&nbsp; cmake_minimum_required( VERSION 2.6 )<br>&nbsp; mark_as_advanced( CMAKE_BACKWARDS_COMPATIBILITY )<br><br>&nbsp; include( "$ENV{CMAKE_ADDITIONAL_MODULES_DIR}/CommonRules.cmake" )<br>&nbsp; include( "Project.cmake" )<br><br>&nbsp; set(UTIL_SOURCES ByteArray.cpp command.cpp Config.cpp Logger.cpp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringUtils.cpp Time.cpp Guard.cpp)<br><br>ELSE(BUILD_STANDALONE)<br><br>&nbsp; set(_UTIL "$ENV{COMMON_INCDIR}/util")<br>&nbsp;
 #set(CMAKE_SOURCE_DIR ${_UTIL} ${CMAKE_SOURCE_DIR})<br><br>&nbsp; set(UTIL_SOURCES ${_UTIL}/ByteArray.cpp ${_UTIL}/command.cpp ${_UTIL}/Config.cpp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${_UTIL}/Logger.cpp ${_UTIL}/StringUtils.cpp ${_UTIL}/Time.cpp<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${_UTIL}/Guard.cpp)<br><br>ENDIF(BUILD_STANDALONE)<br><br># target<br>set(util_LIBRARIES util)<br>add_library(${util_LIBRARIES} ${UTIL_SOURCES})<br><br><br>--- On <b>Wed, 1/26/11, Eric Noulard <i>&lt;eric.noulard@gmail.com&gt;</i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Eric Noulard &lt;eric.noulard@gmail.com&gt;<br>Subject: Re: [CMake] how to specify dependencies out of the source tree?<br>To: "Michal Turlik" &lt;michal_tlk@yahoo.com&gt;<br>Cc:
 cmake@cmake.org<br>Date: Wednesday, January 26, 2011, 12:44 PM<br><br><div class="plainMail">2011/1/26 Michal Turlik &lt;<a ymailto="mailto:michal_tlk@yahoo.com" href="/mc/compose?to=michal_tlk@yahoo.com">michal_tlk@yahoo.com</a>&gt;<br>&gt;<br>&gt; Hi all<br>&gt; I am trying to build and link against a dependency out of the source tree.<br>&gt; I tried to arrange a custom target/command combo but it did not work.<br>&gt; Could someone help me with this?<br>&gt; What I really need is how to let cmake and make be correclty launched for such an out of tree dependency before it would be linked with my application.<br>&gt; thank you so much<br><br>Did you have a look at ExternalProject_Add from ExternalProject module?<br><br>see:<br>cmake --help-module ExternalProject<br><br><br>--<br>Erk<br>Membre de l'April - « promouvoir et défendre le logiciel libre » -<br><a href="http://www.april.org"
 target="_blank">http://www.april.org</a><br></div></blockquote></td></tr></table><br>