[Qt-creator] Cmake parser
Daniel Teske
daniel.teske at nokia.com
Mon Mar 21 13:04:02 CET 2011
On Tuesday 15 March 2011 22:37:48 ext Alexander 'hatred' Drozdoff wrote:
> 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_c
> reator_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?
That doesn't look like a hack to me, as far as I can see that would be the
correct fix. Since it is a patch against cmake, please either create a bug
report with a patch attached in the cmake bug tracking or write to the cmake
mailing list.
daniel
More information about the Qt-creator-old
mailing list