kdev4 assert with findQt4.cmake provided by default cmake install

cedric cedric.borgese at gmail.com
Fri Apr 25 23:51:48 UTC 2008

when you try to import a cmake project that use qt4, this code in 
FindQt4.cmake (the one from the cmake project, in the kde svn provided one, 
the code isn't present)

    LIST(FIND ${qt4_files} OPTIONS _index)
    IF(NOT _index EQUAL -1)
      LIST(REMOVE_ITEM ${qt4_files} OPTIONS)
      LIST(LENGTH ${qt4_files} _length)
      WHILE(_length GREATER ${_index})
        LIST(GET ${qt4_files} ${_index} _opt_value)
        LIST(REMOVE_AT ${qt4_files} ${_index})
        LIST(APPEND ${qt4_options} ${_opt_value})
        LIST(LENGTH ${qt4_files} _length)
      ENDWHILE(_length GREATER ${_index})
    ENDIF(NOT _index EQUAL -1)

cause an assert in cmakeast.cpp line 2225 when parsing the line " 
LIST(REMOVE_AT ${qt4_files} ${_index})"

the problem comes from LIST(FIND ${qt4_files} OPTIONS _index) that is not 
defined (see cmakeprojectvisitor.cpp line 1079) and _index (and its value) is 
not added to the list of variables (m_vars)
this finish as an assertion when trying to convert the value of _index to an 

I write the attached patch (not sure at all it is the right way to do it, but 
at least it works) and now I can import my project.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdevelop.patch
Type: text/x-diff
Size: 692 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20080426/21045aa4/attachment.bin>

More information about the KDevelop-devel mailing list