Removed unnecessary error check in CMakeLists.txt