diff options
author | Kevin Funk <kevin.funk@kdab.com> | 2019-02-12 22:39:35 +0100 |
---|---|---|
committer | Kevin Funk <kevin.funk@kdab.com> | 2019-02-14 07:38:50 +0000 |
commit | 0896e203d651af55008aefa6edb7da940c27c02a (patch) | |
tree | 2aca77754d36b1aafc979f6bc3eff8cb47ce9873 | |
parent | b2337e1d005212b607dd1bd6c8413c0d9b3b1bc2 (diff) |
cmake: Make sure QT_SYNCQT is persisted
Lifetime of the variable is bound to the function body. Use a CACHE
variable to escape it (and to speed up future calls to the function).
Change-Id: I2d164a1c94e64cc652e65c1eea0522f3d911ad82
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | cmake/QtBuild.cmake | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 93369ee965..c63081d8c0 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -169,14 +169,16 @@ endfunction() function(qt_ensure_sync_qt) qt_ensure_perl() - if(NOT DEFINED QT_SYNCQT) - get_target_property(mocPath "${QT_CMAKE_EXPORT_NAMESPACE}::moc" LOCATION) - get_filename_component(binDirectory "${mocPath}" DIRECTORY) - # We could put this into the cache, but on the other hand there's no real need to - # pollute the app's cache with this. For the first qtbase build, the variable is - # set in global scope. - set(QT_SYNCQT "${binDirectory}/syncqt.pl") + if(DEFINED QT_SYNCQT) + return() endif() + + get_target_property(mocPath "${QT_CMAKE_EXPORT_NAMESPACE}::moc" LOCATION) + get_filename_component(binDirectory "${mocPath}" DIRECTORY) + # We could put this into the cache, but on the other hand there's no real need to + # pollute the app's cache with this. For the first qtbase build, the variable is + # set in global scope. + set(QT_SYNCQT "${binDirectory}/syncqt.pl" CACHE FILEPATH "syncqt script") endfunction() # A version of cmake_parse_arguments that makes sure all arguments are processed and errors out |