[Qt-creator] Cmake parser

Alexander 'hatred' Drozdoff adrozdoff at gmail.com
Tue Mar 15 22:37:48 CET 2011


Hi all!

I use Qt Creator with cmake and observer wrong behaviour: after import project to Qt Creator I see
files (sources) only for executables and lib targets. I can't see any other files (like scripts,
README & etc). Creator use CodeBlocks project (generated by cmake) file for import targets and
sources list, but cmake generator for CodeBlocks look like wrong. I make small patch for Cmake that
partly fix this issue:
http://hatred.homelinux.net/wiki/_export/code/zhurnal/2011-03-15_15.08_qt_creator_i_cmake?codeblock=0
~~~~~~ cut here ~~~~~~
--- cmExtraCodeBlocksGenerator.cxx.orig 2011-03-15 14:28:30.692010962 +1000
+++ cmExtraCodeBlocksGenerator.cxx      2011-03-15 15:01:05.612566928 +1000
@@ -410,12 +410,14 @@
     for (cmTargets::iterator ti = targets.begin();
          ti != targets.end(); ti++)
       {
+      //std::cout << "Type: " << ti->second.GetType() << std::endl;
       switch(ti->second.GetType())
         {
         case cmTarget::EXECUTABLE:
         case cmTarget::STATIC_LIBRARY:
         case cmTarget::SHARED_LIBRARY:
         case cmTarget::MODULE_LIBRARY:
+        case cmTarget::UTILITY:
           {
           const std::vector<cmSourceFile*>&sources=ti->second.GetSourceFiles();
           for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
~~~~~~ cut here ~~~~~~

Next, it CMakeLists.txt now we can describe fake targets, like:
~~~~~~ cut here ~~~~~~
set(script-files
    process-filelist.sh
)
# hack for display in Qt Creator (with patch for CMake)
add_custom_target(scripts true SOURCES ${script-files})
~~~~~~ cut here ~~~~~~

But it look like hack, so my question: Is any improvements expected in cmake parser?

-- 
WBR
Alexander Drozdov
FIDO: 2:5045/41.84
Site: http://hatred.homelinux.net
Site: http://archlinux.org.ru



More information about the Qt-creator-old mailing list