CMakeLists.txt cmake_minimum_required should be first line of CMakeLists.txt file
https://cmake.org/cmake/help/latest/command/cmake_minimum_required.html : "Note Call the cmake_minimum_required() command at the beginning of the top-level CMakeLists.txt file even before calling the project() command. It is important to establish version and policy settings before invoking other commands whose behaviour they may affect. See also policy CMP0000."