redbaron
(Maxim Ivanov)
January 25, 2022, 4:05pm
1
I am switching to presets and can’t figure out how to use installDir
. Is it the same or different than CMAKE_INSTALL_PREFIX
? I have "installDir": "out/${presetName}"
, but it still tries to install to the default CMAKE_INSTALL_PREFIX on my platform .
How to use installDir
correctly?
McMartin
(Alain Martin)
January 25, 2022, 7:35pm
2
Which version
are you specifying in your preset file?
From https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset
This is allowed in preset files specifying version 3 or above.
redbaron
(Maxim Ivanov)
January 25, 2022, 7:37pm
3
I am using preset version 3, my CMake is 3.22.1
redbaron
(Maxim Ivanov)
February 2, 2022, 2:58pm
4
@McMartin , it looks like presets are completely ignored when invoking cmake --install
. How installDir
option in the preset is supposed to work?
redbaron
(Maxim Ivanov)
February 2, 2022, 3:30pm
5
OMG, I made it work. It wasn’t very not intuitive, cmake-presets doc doesn’t mention any of it.
For those who’ll come here in the future, trick is to run both configure AND build from the source dir, unlike other CMake workflows.
First configure: cmake -S . --preset xxx
Then install without changing directory : cmake --build --preset xxx --target install
2 Likes