Refactored CMake files