Hi.

There are some issues with QtAutogen that still bother me and
that I would like to change.


1) Most files get generated in
${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_automoc.dir

Is the ".dir" suffix neccessary? I think is should be removed.


2) Moc files that are manually included by a
#include "moc_<basename>.cpp"
statement get generated in ${CMAKE_CURRENT_BINARY_DIR}

This is not ideal because
- ${CMAKE_CURRENT_BINARY_DIR} must be added to the
  INCLUDE_DIRECTORIES manually in CMakeLists.txt
- Multiple targets may write divergent content
  concurrently to the same moc_<basename>.cpp file.

A better solution would be to generate the moc_<basename>.cpp files in
${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_automoc/include.
AUTOMOC then should automatically add that directory to the
INCLUDE_DIRECTORIES of the origin target.

The same issue is present for AUTOUIC btw. which generates header files
in ${CMAKE_CURRENT_BINARY_DIR}. It could be adapted in the same way.


3) The mocs compilation file currently gets generated as
${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_automoc.cpp

The file could be generated as
${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_automoc/compilation.cpp

This way and along with the changes in 2) all files would be generated in
${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_automoc.
This is nice and contained and allows perfect cleanup by adding
the directory to ADDITIONAL_MAKE_CLEAN_FILES.
The moc/uic cleanup is broken/incomplete in CMake 3.7 btw..


4) AUTOMOC AUTOUIC and AUTORCC perform different independent tasks that
in the current implementation get processed serially inside a single
custom target named ${TARGETNAME}_automoc.

I think each of the three could be handled in an own target.
Then instead on one custom target there would be three custom targets:
- ${TARGETNAME}_automoc
- ${TARGETNAME}_autouic
- ${TARGETNAME}_autorcc
Also each target would generate all files in an own directory:
- ${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_automoc
- ${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_autouic
- ${CMAKE_CURRENT_BINARY_DIR}/${TARGETNAME}_autorcc

Once in place this would also be easier to maintain compared to now
where all three target logics are mixed together in a single C++ class.



Please share your opinion on the points.
If there is no fundamental opposition I will simply
go ahead and work on the patches.

-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