cmake issue: generated files in subdirs
Alexander Neundorf
neundorf at kde.org
Thu Mar 23 19:01:32 GMT 2006
On Thursday 23 March 2006 09:27, Aaron J. Seigo wrote:
> hi =)
>
> so i added this to a CMakeLists.txt file:
>
> kde4_add_ui3_files(krdc_SRCS
> hostprofiles.ui3
> maindialogbase.ui3
> keycapturewidget.ui3
> vnc/vncprefs.ui3)
>
> as you can see, the last ui file is actually in a subdir... but when it
> generates the source code files, it does so in the same directory that the
> CMakeLists.txt file is in rather than the subdir. obviously this is not
> what is desired =)
Well, it's not that obviously.
Basically cmake did exactly what it was told to do, all files it generates are
generated in CMAKE_CURRENT_BINARY_DIR.
Are you building in-source or out-of-source ?
Once you get used to it, out-of-source is much more convenient.
Which problem does this cause for you ?
If you have the problem that there are now two generated files with the same
name, you have hit the leftovers from libtool and the convenience libs.
Now all source files are just compiled at once for one target. So if you have
in different subdirs files with the same name, the generated moc files will
have the same name. Even if they would be generated in different directories
(which they are not currently), this wouldn't help anything.
In order to find them, the path to them would have to be part of the include
path. Which would mean the path to both files with the same name would be in
the include path, and that for both files. Which would have the effect that
both times when e.g. foo.moc gets included the same foo.moc would be
included.
Are you building in-source or out-of-source ?
Once you get used to it, out-of-source is much more convenient. And when
building out-of-source, the moc files have to be found via the include path,
because they live in the build tree, while the source files including them
live in the source tree.
So, what is the exact problem ? Maybe it's just a missing path in the include
path ?
Bye
Alex
--
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org - http://www.kde.org
alex AT neundorf.net - http://www.neundorf.net
More information about the kde-core-devel
mailing list