CMake: Make qt5_use_modules a macro, not a function.
authorStephen Kelly <stephen.kelly@kdab.com>
Mon, 22 Oct 2012 07:32:24 +0000 (09:32 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 22 Oct 2012 20:42:22 +0000 (22:42 +0200)
commit6fe8a3d5a1c1f2b963fe25e9032b562f6c6467e6
tree4bebdd99b0fda69ef648b8367013c3ea46934ebc
parent4dbf60d672a24a56e830654c386517b71d83bf85
CMake: Make qt5_use_modules a macro, not a function.

Because qt5_use_modules is a function that does a find package which
finds imported targets, things like this:

 qt5_use_modules(foo Sql)
 if (TARGET Qt5::Sql)
    message("Qt5Sql_FOUND: ${Qt5Sql_FOUND}")
 endif()

will show Qt5Sql as being not found, even though the target is in scope.

Fix that by making it a macro instead.

Change-Id: If314bd5b4d3f769c6c7df5ff2c924eabd16dcc0e
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
src/corelib/Qt5CoreMacros.cmake