summaryrefslogtreecommitdiffstats
path: root/cmake/QtFileConfigure.txt.in
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-03-20 15:03:54 +0100
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-03-23 09:54:56 +0100
commite510a4e32789327a49b0b2eeea3564bb502b881f (patch)
treef831908cc17b29126bf5f0fcc871a2402d5a4178 /cmake/QtFileConfigure.txt.in
parent16df037f9dcced9b3efc7457e50491ce0363e125 (diff)
CMake: Introduce qt_configure_file
It has the same kind of signature as file(GENERATE) but creates the files at configure time rather than generation time. CMake provides a few ways to generate files file(WRITE) -> always overrides content configure_file() -> only overrides if content changes, creates file at configure time, can only take a file as input file(GENERATE) -> only overrides if content changes, creats file at generation time, can take a string or file as input Because dealing with an input file is a hassle (need to create one, make sure it's installed, make sure it's used correctly in the various build types like super-build, non-prefix-build, etc) people tend to use file(GENERATE) instead, which can take a string argument, and is thus easier to use. Unfortunately that introduces subtle bugs because the file is created at generation time, but there are existence checks which are done at configuration time. Thus qt_configure_file allows creation of files at configure time, without having to provide an input file. Underneath it uses configure_file(). Once CMake 3.18 is released, the implementation can be switched to use file(CONFIGURE). Change-Id: Ic8f8d88541ef0b25d01af143352c8c9ba390ad5f Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtFileConfigure.txt.in')
-rw-r--r--cmake/QtFileConfigure.txt.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/cmake/QtFileConfigure.txt.in b/cmake/QtFileConfigure.txt.in
new file mode 100644
index 0000000000..53cae29ccc
--- /dev/null
+++ b/cmake/QtFileConfigure.txt.in
@@ -0,0 +1 @@
+@__qt_file_configure_content@