[CMake] problem with CheckXXX.cmake files

Pedro Lopez-Cabanillas pedro.lopez.cabanillas at gmail.com
Tue Feb 27 17:59:10 EST 2007


On Tuesday, 27 February 2007 23:11, Alexander Neundorf wrote:
> in cmake e.g. the FIND_LIBRARY() and friends calls return "NOTFOUND" if
> they didn't succeed and this has the effect that they search again when
> cmake runs the next time.
>
> E.g. CHECK_LIBRARY_EXISTS() and CHECK_INCLUDE_FILES() don't seem to work
> that way. If they fail, the value is set to "", and they don't try again.
> Is this intentional ? We have the problem that in FindX11.cmake the
> following call fails if the X11 development stuff isn't installed, and
> after installing it it doesn't check again:
>
> CHECK_LIBRARY_EXISTS("ICE" "IceConnectionNumber" "${X11_LIBRARY_DIR}"
>                          CMAKE_LIB_ICE_HAS_ICECONNECTIONNUMBER)
>
> The attached patch helps against this, but I'm not sure it should really
> run again every time.

IMO, if a required dependency was not found when cmake checked it, it should 
be tested again the next time that you run cmake, and once again until it is 
installed. 

I've seen this type of problem that you have found for X11 in Rosegarden 
mailing lists. An user trying to compile Rosegarden finds that cmake 
complains about some required 3rd party library that is missing. He installs 
the library and runs cmake again, but the library is not checked again and 
the build process fails at some point.

Our problem was caused for a bug in FindPkgConfig.cmake in current CVS head. 
I've fixed it in a local copy of the module for Rosegarden, and opened a bug 
report with a patch attached to it. 
http://www.cmake.org/Bug/bug.php?op=show&bugid=4148

Regards,
Pedro


More information about the CMake mailing list