Updated CmakeLists.txt with rearranging cache variables.