[CMake] FindQt4.cmake to automatically include QT_USE_FILE?
Bjørn Forsman
bjorn.forsman at gmail.com
Tue Jun 7 15:13:00 EDT 2011
2011/6/7 Michael Wild <themiwi at gmail.com>:
> If the FindXXX.cmake file called add_definitions(),
> include_directories() et al., that could be potentially harmful. Some
> sources might required that some define is not set, or a wrong header
> file might be #include'ed (thing of all the different X.h that exist).
> FindXXX.cmake modules should just define a few variables, *not* change
> the build system. That's the caller's responsibility, either by calling
> the functions himself or by including the UseXXX.cmake (if provided).
Ok, I see the point now. However, if find_package is called only in
the subdirectories that actually need it the above problem is
non-existent. No? (At least add_definitions only work on the current
dir and below.) But if the policy is they way it is, then OK, I get
the point and I'll leave it at that.
However, according to Modules/readme.txt, FindXXX.cmake files should
set XXX_LIBRARIES, XXX_INCLUDE_DIRS and XXX_DEFINITIONS. FindQt4.cmake
sets neither. I can try to come up with a patch to fix this, but I
won't complain if someone beats me to it ;-)
Best regards,
Bjørn Forsman
More information about the CMake
mailing list