[cmake-developers] How to use cmake::SetCacheArgs(...)?
Tobias Hunger
tobias.hunger at gmail.com
Wed Nov 30 12:06:47 EST 2016
Hello CMake developers,
I am trying to pass a number of arguments to cmake server-mode's
configure command. The exact call is:
[== "CMake Server" ==[
{
"cacheArguments": [
"-DCMAKE_BUILD_TYPE:STRING=Debug",
"-DCMAKE_CXX_COMPILER:STRING=/usr/lib/ccache/bin/g++",
"-DCMAKE_C_COMPILER:STRING=/usr/lib/ccache/bin/gcc",
"-DCMAKE_PREFIX_PATH:STRING=/usr",
"-DQT_QMAKE_EXECUTABLE:STRING=/usr/bin/qmake"
],
"cookie": 2,
"type": "configure"
}
]== "CMake Server" ==]
These are then fed into cmake::SetCacheArgs(...) by server-mode. That
call succeeds and I do see my values in the Cache once that is done
(via cmCacheManager::PrintCache(...)).
I then proceed to call cmake::Configure(...). That says something
about having to start over with a clean cache since the compiler
changed (which is correct).
After cmake::Configure(...) returns values some of the values are gone
again. E.g. CMAKE_BUILD_TYPE changed back from "Debug" to "".
Is this expected behavior?
When I resend the configure command to the cmake server all values stick.
Is that what I need to do? How do I know whether or not I need to
rerun configure again? Is there any telltale sign or at any
machine-readable notification that I need to send my data again? Or is
the procedure to just rerun configure with all arguments till the
cache no longer changes?
Best Regards,
Tobias
More information about the cmake-developers
mailing list