Bug in CheckLibraryExists.cmake

David Faure faure at kde.org
Fri Feb 10 15:41:42 CET 2006


cmake from cvs:

    SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
    IF(CMAKE_REQUIRED_LIBRARIES)
      SET(CHECK_LIBRARY_EXISTS_LIBRARIES
        ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES})
    ELSE(CMAKE_REQUIRED_LIBRARIES)
      SET(CHECK_LIBRARY_EXISTS_LIBRARIES)
    ENDIF(CMAKE_REQUIRED_LIBRARIES)

Doesn't the "else" part remove what the first line did?
Because of that, the LIBRARY argument seems simply unused, and the following test fails:

   check_library_exists(${BZIP2_LIBRARY} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
(where BZIP2_LIBRARY was correctly set to /usr/lib/libbz2.so)

Removing the "ELSE" part fixes the problem for me.

--
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).



More information about the Kde-buildsystem mailing list