Problem with building project by CMake
Assuming you installed gcc using brew, run brew info gcc. Find the path similar to /usr/local/Cellar/gcc/9.2.0. Go the that directory and find gcc file in bin. Copy the path name and paste it in Cmake (assuming GUI) as follows.

After cleaning cache in File -> Delete cache, start afresh in Tools -> Configure. Specify "Unix Makefiles" instead of Xcode and select "Specify native compilers."



In the compilers for C and C++, copy the full path found above. Similar to /usr/local/Cellar/gcc/9.2.0/bin/gcc-9. 



And then try configuring. And update me with the log afterwards.