Hi!
I have a boolean cache variable MY_VARIABLE
that is used via configure_file
and #ifdef
to change what parts of my code are build. By default it is turned off. But if I change the variable with -DMY_VARIABLE=ON
during the configure step the configure file is not updated.
That is probably because the input configure file has not changed. But how do I get MY_VARIABLE
into my program so that #ifdef
works? I tried to run cmake -E touch
on my input configure file, but that also didn’t lead to any changes. The only way it works for me is to completely delete the build directory and reconfigure.
Thanks in advance for any pointers on this, I have been trying to get this to work for weeks.