I thank you so much Eric, However I managed this thing and obteined the expected result by writing something similar and then including it in my root CMakeLists.txt:
----- util lib dependency ----- # -*- Makefile -*- IF(BUILD_STANDALONE) project( util_lib_pro ) # compatibility issues cmake_minimum_required( VERSION 2.6 ) mark_as_advanced( CMAKE_BACKWARDS_COMPATIBILITY ) include( "$ENV{CMAKE_ADDITIONAL_MODULES_DIR}/CommonRules.cmake" ) include( "Project.cmake" ) set(UTIL_SOURCES ByteArray.cpp command.cpp Config.cpp Logger.cpp StringUtils.cpp Time.cpp Guard.cpp) ELSE(BUILD_STANDALONE) set(_UTIL "$ENV{COMMON_INCDIR}/util") #set(CMAKE_SOURCE_DIR ${_UTIL} ${CMAKE_SOURCE_DIR}) set(UTIL_SOURCES ${_UTIL}/ByteArray.cpp ${_UTIL}/command.cpp ${_UTIL}/Config.cpp ${_UTIL}/Logger.cpp ${_UTIL}/StringUtils.cpp ${_UTIL}/Time.cpp ${_UTIL}/Guard.cpp) ENDIF(BUILD_STANDALONE) # target set(util_LIBRARIES util) add_library(${util_LIBRARIES} ${UTIL_SOURCES}) --- On Wed, 1/26/11, Eric Noulard <eric.noul...@gmail.com> wrote: From: Eric Noulard <eric.noul...@gmail.com> Subject: Re: [CMake] how to specify dependencies out of the source tree? To: "Michal Turlik" <michal_...@yahoo.com> Cc: cmake@cmake.org Date: Wednesday, January 26, 2011, 12:44 PM 2011/1/26 Michal Turlik <michal_...@yahoo.com> > > Hi all > I am trying to build and link against a dependency out of the source tree. > I tried to arrange a custom target/command combo but it did not work. > Could someone help me with this? > 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. > thank you so much Did you have a look at ExternalProject_Add from ExternalProject module? see: cmake --help-module ExternalProject -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org
_______________________________________________ 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