[CMake] Debian SID / CMake 3.5.0-1 / FindBoost / CTest

Vincent Huber vincent.huber at cemosis.fr
Tue Mar 29 05:12:49 EDT 2016


Thank you for your precise and clear answer !

2016-03-29 10:54 GMT+02:00 Nils Gladitz <nilsgladitz at gmail.com>:

> On 03/29/2016 10:31 AM, Vincent Huber wrote:
>
> Hello everyone,
>
> In a CTest process, I have to determine the Boost_VERSION.
> To do so, I just add FIND_PACKAGE(Boost) to my configuration file.
> I didn’t had any problems since a cmake update on Debian/SID to cmake
> 3.5.0.
>
> From now, I have:
> -- Looking for boost CMake Error at
> /usr/share/cmake-3.5/Modules/FindBoost.cmake:896 (add_library): Unknown
> CMake command "add_library". Call Stack (most recent call first):
> /home/vhuber/feelpp/cmake/dashboard/testsuite.cmake:328 (FIND_PACKAGE)​
>
> ​If I run a standard cmake process with a FIND_PACKAGE(Boost) everything
> goes well.
>
> I do not clearly understand what is going on.
>
>
> add_library() is used by an increasing number of find modules to define
> IMPORTED targets.
> IMPORTED targets are the preferred and most convenient way to use
> libraries located by find modules.
>
> Since add_library() is only meaningful in build system definitions it is
> not available to ctest.
>
> ​I do not have theses problems with cmake 3.4.3
>
> What can I do to solve that problem ?
>
>
> You haven't mentioned why you need to determine the Boost version in your
> ctest script but if you do still require it I would implement custom logic
> (you could base it on the existing logic in FindBoost.cmake).
>
> Using library find modules from any context other than cmake project files
> is ill defined even before the changes that introduced imported targets.
> The boost find module specifically uses compiler and platform information
> that is not available in ctest scripts (e.g. boost library file names can
> be mangled differently depending on which compilers/versions are used and
> can be located differently depending on bitness).
>
> Nils
>
>


-- 
Docteur Ingénieur de recherche
CeMoSiS <http://www.cemosis.fr> - vincent.huber at cemosis.fr
Tel: +33 (0)3 68 8*5 02 06*
IRMA - 7, rue René Descartes
67 000 Strasbourg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160329/f50965b7/attachment.html>


More information about the CMake mailing list