Fix messages in CMake scripts and add proper input managing