I would like to detect whether the CMakeLists.txt file is run with sudo priveleges, so that an application for example on macOS can be installed to the /Application directory while if it is not, it installed into CMAKE_INSTALL_PREFIX/bin.
Can this be done somehow?