[CMake] Multiple calls to find_package(Boost) with different components

Adolfo Rodríguez Tsouroukdissian dofo79 at gmail.com
Mon Dec 21 04:37:56 EST 2009


Hi all,

I have a use case where find_package(Boost COMPONENTS xxx) is called more
than once, and each time with a different set of components, as in the
following example:


cmake_minimum_required(VERSION 2.6)
project(MyBoost)

find_package(Boost REQUIRED COMPONENTS date_time)
message(STATUS "1st call: Boost_LIBRARIES=${Boost_LIBRARIES}")

find_package(Boost REQUIRED COMPONENTS regex)
message(STATUS "2nd call: Boost_LIBRARIES=${Boost_LIBRARIES}")


Upon configuring the project for the first time, everything works as
expected, and the relevant output I get is:
-- 1st call: Boost_LIBRARIES=/opt/boost/lib/libboost_date_time-mt.so
-- 2nd call:
Boost_LIBRARIES=/opt/boost/lib/libboost_date_time-mt.so;/opt/boost/lib/libboost_regex-mt.so


Now if I clear all non-internal Boost_* cache variables, such as by removing
the Boost group in cmake-gui and reconfigure my project, I get
-- 1st call: Boost_LIBRARIES=/opt/boost/lib/libboost_date_time-mt.so
-- 2nd call: Boost_LIBRARIES=/opt/boost/lib/libboost_date_time-mt.so


Which is unexpected. Should the above example work for the two described
scenarios, or am I entering some state that yields undefined behavior?

Thanks in advance,

Adolfo

-- 
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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091221/5b0e6225/attachment-0001.htm>


More information about the CMake mailing list