Cmake-Gui : CMAKE_SOURCE_DIR bug
https://discourse.cmake.org/t/cmake-gui-not-detecting-top-level-project/2142
This discussion covers the bug pretty well but essentially it boils down to this.
Note in the above picture the source directory ends with a trailing '/'
This causes problems when users check for the top level project. Here is some example code that hit this bug.
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
set(FOOBAR_IS_TOP_LEVEL ON)
endif()
The project will never be top level because CMAKE_SOURCE_DIR will end in a trailing '/' while CMAKE_CURRENT_SOURCE_DIR will not.
Basically the inputs of cmake-gui need to be sanitized to prevent this type of error.