Am 12.04.2016 um 13:43 schrieb Sebastian Holtermann:
Sorry for the noise.

I've stumbled over bug
https://cmake.org/Bug/view.php?id=12873
a few times now since I like to use same named data/view classes.

I've prepared a fix that generates all moc_xxx.cpp files
in the foo_automoc.dir subdirectory.


I had some more thoughts about this.

CMAKE_CURRENT_BINARY_DIR /
  foo_automoc.cpp
  foo_automoc.dir/data/moc_item.cpp
  foo_automoc.dir/view/moc_item.cpp
  foo_automoc.dir/moc_item.cpp

With directory based moc file generation it is complicated to allow "#include <moc_foo.cpp>" (I've never included mocs btw.).
Putting every moc directory into the target INCLUDE_DIRECTORIES
won't help because then there would be multiple moc_item.cpp
files that match "include <moc_item.cpp>".
If per source INCLUDE_DIRECTORIES were possible it might work though.

My proposal is this:

- Moc files that are "#include<>"d get generated in
CMAKE_CURRENT_BINARY_DIR/moc_xxx.cpp as before but with
name collision test.

- Moc files not included but detected from
headers get generated in
CMAKE_CURRENT_BINARY_DIR/foo_automoc.dir/
with subdirectory support.
Since they're not included it doesn't matter where they are as long as
they don't overwrite each other.


I'll prepare another patch for this...

Kind regards,
Sebastian



--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to