[Qt-creator] Running "install" on one sub directory for CMake (variable/substitution issue)

Eike Ziller Eike.Ziller at qt.io
Fri Apr 12 11:53:36 CEST 2019



> On 12. Apr 2019, at 11:28, Toralf Lund <toralf.lund at pgs.com> wrote:
> 
> Hei
> 
> In my CMake project, I'm trying to set up a configuration that does and "install" type build only on the directory of the current document or possibly of the current executable. Technically, I can achieve what I want by running
> 
> cmake --build . --target install -- -C <relative path>
> 
> on the "top" build directory, where <relative path> is the file's directory relative to the "project directory", but how do I express that in Qt Creator?

%{JS: Util.relativeFilePath(‘%{CurrentDocument:Path}’, ‘%{CurrentProject:Path}’) }

should work :)

> I can't seem to find variables for relative paths, or a reliable and general way to remove the initial path components. I mean, the path I want is something like
> 
> %{CurrentDocument:Path/%{CurrentProject:Path}/}
> 
> but that substitution won't work because %{CurrentProject:Path} also contains '/'. (This is on a Linux system.)
> 
> I've actually managed to set up a working config for my source code tree via pattern containing hard-coded path components, but that does not seem entirely ideal.
> 
> So, is there a way I can get "project-relative" paths? Or can anyone think of a better way to achieve what I want? I know there is special support for building the current executable, but that's not exactly what I'm looking for - I'd like to build and install everything on its directory.
> 
> - Toralf
> 
> _______________________________________________
> Qt-creator mailing list
> Qt-creator at qt-project.org
> https://lists.qt-project.org/listinfo/qt-creator

-- 
Eike Ziller
Principal Software Engineer

The Qt Company GmbH
Rudower Chaussee 13
D-12489 Berlin
eike.ziller at qt.io
http://qt.io
Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B



More information about the Qt-creator mailing list