cmake - list无法识别子命令FILTER

时间:2017-02-10 19:41:19

标签: cmake

cmake --version
cmake version 3.5.2

list(FILTER HEADERS EXCLUDE REGEX "^\\..+")

CMake Error at CMakeLists.txt:49 (list):
  list does not recognize sub-command FILTER

我使用的版本有问题吗?

它在ubuntu上。它是官方ubuntu存储库中的最新版本。

它在Mac上运行良好,版本为3.6.2

提供此功能的最少cmake版本是什么?

1 个答案:

答案 0 :(得分:6)

这是可以预期的,func save(name: String, logo: String, stockPrice: String) { guard let appDelegate = UIApplication.shared.delegate as? AppDelegate else { return } let managedContext = appDelegate.persistentContainer.viewContext let entity = NSEntityDescription.entity(forEntityName: "Company", in: managedContext)! let company = NSManagedObject(entity: entity, insertInto: managedContext) company.setValue(stockPrice, forKey: "stockPrice") company.setValue(name, forKey: "name") company.setValue(logo, forKey: "logo") do { try managedContext.save() companies.append(company) } catch let error as NSError { print("Could not save. \(error), \(error.userInfo)") } tableView.reloadData() } 是在CMake 3.6中引入的。

https://cmake.org/cmake/help/v3.5/command/list.html https://cmake.org/cmake/help/v3.6/command/list.html