try_run error : "recursive or nested TRY_COMPILE"
My CMake project fails when using 'try_run' with the error as try_compile failed but it passes if I use try_compile directly into my project. Error message that I could see with try_run is as below.
**CMake Error at CMakeLists.txt:36 (try_run): Attempt at a recursive or nested TRY_COMPILE in directory
/<my_path>/<my_CMake_proj>/build CMake Error: TRY_COMPILE attempt to remove -rf directory that does not contain CMakeTmp:/<my_path>/<my_CMake_proj>/build
-- -- Configuring incomplete, errors occurred!**__
I have attached my CMakeList.txtCMakeList.txt
System environment: Linux:Ubuntu 18.04 cmake : 3.21.2