Yes you should prefix cache variables with your targets/projects prefix.
This allows for the cmake-gui to also have nicer grouping, making a nice interface to the user.
This solution isn’t perfect for 100% of cases. But it handles most things.
Here is an example of 3 widely used open sourced projects that do this: