try_run certain configuration
I want to try the different configurations (Debug, Release, ...) and see if their flags will allow building the code I am working on. In order to test that, I have written a test that will be passed using try_run if asserts are kept in (i. e., if not compiling with NDEBUG). Different configurations are successfully tested setting the variable CMAKE_TRY_COMPILE_CONFIGURATION, so that by default, Debug will pass (using flags -g), and release will fail (using flags -O3 -DNDEBUG).
The problem is that these tests do not use the current value of the cached variable CMAKE_CXX_FLAGS_, but their default values. Is it a bug? I would have expected these to be pulling the actual values of the corresponding variables.
Tested with CMake version 3.10.0-rc4.