Qt Creator Projects tab CMake Build steps "Stage for installation"
-
Can anyone shed any light on how the new "Stage for installation" checkbox added in Qt Creator 11 to the Project tab CMake build steps actually works?
Running on Ubuntu 22.04 build host
It's caused me grief in a situation where my CMake super-project builds a sub-project pulled in using ExternalProject_Add() and performs a faux-install of the subproject with path specified by CMAKE_INSTALL_PREFIX in order for the superproject to be able to access resources generated by the subproject without having to dig deep into it's internal build folders. With "Stage for installation" turned on the install occurs in the associated temporary staging directory with my CMAKE_INSTALL_PREFIX value appended.
I've figured out what's going on and obviously can turn "Stage for installation" off, however I'd prefer to enhance my scripts to handle it, however it's not at all clear exactly how Qt Creator is specifying/imposing the "Stage for installation" path on the CMake configure & build process and how I can detect that it is in effect from within my script. It doe not appear to be part of the CMake invocation command line, in particular does not seem to be present in CMAKE_INSTALL_PREFIX
-
And at https://gitlab.kitware.com/cmake/cmake/-/issues/18165 there is an issue regarding
DESTDIR
andExternalProject_Add
with a workaround! -
Qt Creator sets the environment variable
DESTDIR
for that purpose.See https://devdocs.io/cmake~3.24/envvar/destdir for more information.
-
And at https://gitlab.kitware.com/cmake/cmake/-/issues/18165 there is an issue regarding
DESTDIR
andExternalProject_Add
with a workaround! -
@cristian-adam thanks cristian, that's what I'm after
-