Hi Adolfo, I cannot reproduce the problem you mention. I made the following CMakeLists.txt file:
cmake_minimum_required(VERSION 2.6) project(MyBoost) find_package(Boost REQUIRED COMPONENTS date_time) message(STATUS "Boost_FOUND=${Boost_FOUND}") message(STATUS "Boost_LIBRARIES=${Boost_LIBRARIES}") find_package(Boost REQUIRED COMPONENTS regex) message(STATUS "Boost_FOUND=${Boost_FOUND}") message(STATUS "Boost_LIBRARIES=${Boost_LIBRARIES}") Running cmake (2.6.2) produces: -- The C compiler identification is GNU -- The CXX compiler identification is GNU -- Check for working C compiler: /usr/bin/gcc -- Check for working C compiler: /usr/bin/gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Boost version: 1.36.0 -- Found the following Boost libraries: -- date_time -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so -- Boost version: 1.36.0 -- Found the following Boost libraries: -- regex -- Boost_FOUND=TRUE -- Boost_LIBRARIES=/usr/lib64/libboost_date_time-mt.so;/usr/lib64/libboost_regex-mt.so -- Configuring done -- Generating done So, in my case boost_regex is nicely added to boost_date_time. Best regards, Marcel Loose. On Fri, 2009-12-18 at 10:48 +0100, Adolfo Rodríguez Tsouroukdissian wrote: > > > On Fri, Dec 18, 2009 at 10:19 AM, Marcel Loose <lo...@astron.nl> > wrote: > Hi Roman, > > Not in a portable way. I'm not too familiar with Windows, but > on Linux > you can do this when libA is a shared library that has its > dependency on > libB linked in (e.g. ldd libA.so will tell you this). When > linking in > static libraries you're out of luck. > > I would write a FindA.cmake file for this and let that macro > set the > variable A_LIBRARIES to contain both libA and libB. You can > then use: > > find_package(A) > target_link_libraries(${A_LIBRARIES}) > > I've had to deal with this issue and Marcel's proposal is what I do. > There is one slight gotcha that I haven't resolved cleanly yet. > Suppose that A_LIBRARIES depends on certain Boost components, so > inside FindA.cmake I perform a > > find_package(Boost REQUIRED COMPONENTS xxx yyy) > > and append Boost_LIBRARIES to A_LIBRARIES. Note: I use find_package > instead of hardcoding the library names so that libraries appear as > fully qualified paths, and nonstandard installation paths can be used. > Everything OK for now. > > Now, in my project, which depends on A and some other Boost component > I do > > find_package(A) > find_package(Boost REQUIRED COMPONENTS zzz) > > What happens is that since Boost was already found in A, the zzz > component is not included in Boost_LIBRARIES. Has anybody found a > successful way of dealing with this? > > TIA, > > Adolfo > > > > > Hope this helps, > Marcel Loose. > > > > On Thu, 2009-12-17 at 12:18 -0500, Roman Shtylman wrote: > > Is there an easy way to setup link dependencies between > libraries not > > build using cmake? > > > > Lets say I have a system library A which depends on system > library B. > > I then make an executable that uses code from A. I need to > link > > against A and B, but as a user of just library A, I don't > want to > > worry about that. Does cmake have a facility to define such > a > > hierarchy/dependency chain so that I can just do > > > > target_link_libraries(<target> A) > > > > and have it figure out that it needs to link against B as > well? > > > > Note that neither A nor B are built using cmake, they > already exist. > > > > ~Roman > > _______________________________________________ > > 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 > > _______________________________________________ > 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 > > > > > -- > Adolfo Rodríguez Tsouroukdissian, Ph. D. > > Robotics engineer > PAL ROBOTICS S.L > http://www.pal-robotics.com > Tel. +34.93.414.53.47 > Fax.+34.93.209.11.09 > AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, > pueden contener información privilegiada y/o confidencial que está > dirigida exclusivamente a su destinatario. Si usted recibe este > mensaje y no es el destinatario indicado, o el empleado encargado de > su entrega a dicha persona, por favor, notifíquelo inmediatamente y > remita el mensaje original a la dirección de correo electrónico > indicada. Cualquier copia, uso o distribución no autorizados de esta > comunicación queda estrictamente prohibida. > > CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) > may contain confidential information which is privileged and intended > only for the individual or entity to whom they are addressed. If you > are not the intended recipient, you are hereby notified that any > disclosure, copying, distribution or use of this e-mail and/or > accompanying document(s) is strictly prohibited. If you have received > this e-mail in error, please immediately notify the sender at the > above e-mail address. _______________________________________________ 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