On 2016-10-20 13:48-0500 Steve Lorimer wrote:

Sounds like you have ended up at the same solution I did. I had trouble
getting the automated qt generation working, and in the end I made it
explicit

if(ARG_MOC)
qt5_wrap_cpp(MOC_OUT ${ARG_MOC})
endif()
if(ARG_RES)
qt5_add_resources(RES_OUT ${ARG_RES})
endif()
if(ARG_UI)
qt5_wrap_ui(UI_OUT ${ARG_UI})
endif()

add_library(
${ARG_NAME}
${LINK}
${ARG_SRCS} ${MOC_OUT} ${RES_OUT} ${UI_OUT}
)

Hi Steve:

Thanks for your additional comment.

Yes, I agree explicit is always a good fallback when automatic doesn't
work, but I am hoping the indirect result of this discussion is the
CMake developers will remove the limitations and deficiencies of the
automatic methods supporting Qt5 so they are a lot more useful for
complex real-world software projects.

One especially useful thing I realized from your post is my current
use of a custom_target that depends on MOC_OUT (in your above
nomenclature) is essentially a no-op since MOC_OUT is generated at
CMake time rather then set up as a custom command to be run at build
time.  So there is more cleanup I need to do of my explicit method.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________
--

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

Reply via email to