<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> project( util_lib_pro )<br><br># compatibility issues<br> cmake_minimum_required( VERSION 2.6 )<br> mark_as_advanced( CMAKE_BACKWARDS_COMPATIBILITY )<br><br> include( "$ENV{CMAKE_ADDITIONAL_MODULES_DIR}/CommonRules.cmake" )<br> include( "Project.cmake" )<br><br> set(UTIL_SOURCES ByteArray.cpp command.cpp Config.cpp Logger.cpp<br> StringUtils.cpp Time.cpp Guard.cpp)<br><br>ELSE(BUILD_STANDALONE)<br><br> set(_UTIL "$ENV{COMMON_INCDIR}/util")<br>
#set(CMAKE_SOURCE_DIR ${_UTIL} ${CMAKE_SOURCE_DIR})<br><br> set(UTIL_SOURCES ${_UTIL}/ByteArray.cpp ${_UTIL}/command.cpp ${_UTIL}/Config.cpp<br> ${_UTIL}/Logger.cpp ${_UTIL}/StringUtils.cpp ${_UTIL}/Time.cpp<br> ${_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><eric.noulard@gmail.com></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Eric Noulard <eric.noulard@gmail.com><br>Subject: Re: [CMake] how to specify dependencies out of the source tree?<br>To: "Michal Turlik" <michal_tlk@yahoo.com><br>Cc:
cmake@cmake.org<br>Date: Wednesday, January 26, 2011, 12:44 PM<br><br><div class="plainMail">2011/1/26 Michal Turlik <<a ymailto="mailto:michal_tlk@yahoo.com" href="/mc/compose?to=michal_tlk@yahoo.com">michal_tlk@yahoo.com</a>><br>><br>> Hi all<br>> I am trying to build and link against a dependency out of the source tree.<br>> I tried to arrange a custom target/command combo but it did not work.<br>> Could someone help me with this?<br>> 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>> 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>