gz-cmake icon indicating copy to clipboard operation
gz-cmake copied to clipboard

Helper functions/macros need improvement for projects using qt

Open osrf-migration opened this issue 6 years ago • 0 comments

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


There are some very nice helper functions and macros for getting the names of source and test files for creating libraries, but they seems to not be that helpful for projects that use qt and need to use the moc compiler on the header files, for example ignition-gui:

https://github.com/ignitionrobotics/ign-gui/blob/d0ce8c1a0b29446e6a1720c459ac8b2a134dfaad/include/ignition/gui/CMakeLists.txt

This currently works by creating the core library in the include/ignition/gui/CMakeLists.txt so that it can invoke the moc compiler on the qt header files. The source files from src are declared with PARENT_SCOPE so they can be added to the library from the include folder.

It currently works, but it seems like there's room for improvement.

osrf-migration avatar Apr 18 '18 00:04 osrf-migration