- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想针对比我自己使用的版本旧的特定版本的 CMake(与 this question 相关,即正确使用 cmake_minimum_required()
),并且能够确定哪些功能要远离会很好从,例如。
是否可以找到在 CMake 中引入某个特性(变量、函数、属性等)的第一个版本?
据我所知,CMake 文档不直接包含此信息(通过发行说明间接包含的信息除外)。一个很好的例子是 Qt API 文档(例如,参见 QCryptographicHash 的文档)。
编辑 :我使用 Florian 提供的解决方案的修改版本创建了一个 git repo:https://github.com/mbitsnbites/cmake-minver
最佳答案
阅读这里的评论后是我的CMake
命令/属性/等的版本。检查器:
CMakeLists.txt
cmake_minimum_required(VERSION 2.8.5)
function(version_required_by)
set(_keywords ${ARGN})
set(_temp_file "${CMAKE_CURRENT_BINARY_DIR}/download.txt")
foreach(_ver IN ITEMS 2.6 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.8.10 2.8.11 2.8.12 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7)
message(STATUS "Check version required: ${_ver}")
if (_ver VERSION_LESS 2.8)
set(_url "https://cmake.org/cmake/help/cmake${_ver}docs.html")
elseif (_ver VERSION_LESS 3.0)
set(_url "https://cmake.org/cmake/help/v${_ver}/cmake.html")
else()
set(_url "https://cmake.org/cmake/help/latest/release/${_ver}.html")
endif()
file(DOWNLOAD "${_url}" "${_temp_file}")
file(READ "${_temp_file}" _help_text)
foreach(_keyword IN LISTS _keywords)
string(FIND "${_help_text}" "${_keyword}" _found)
if (NOT _found EQUAL -1)
message(STATUS "${_keyword} -> v${_ver}")
list(REMOVE_ITEM _keywords "${_keyword}")
endif()
endforeach()
if (NOT _keywords)
message("cmake_minimum_required(VERSION ${_ver} FATAL_ERROR)")
if (NOT CMAKE_MINIMUM_REQUIRED_VERSION)
cmake_minimum_required(VERSION ${_ver} FATAL_ERROR)
endif()
break()
endif()
endforeach()
if (_keywords)
message(FATAL_ERROR "Check version required error: Not found ${_keywords}")
endif()
endfunction()
if (CMAKE_SCRIPT_MODE_FILE)
foreach(_i RANGE 3 ${CMAKE_ARGC})
list(APPEND _args "${CMAKE_ARGV${_i}}")
endforeach()
else()
list(
APPEND _args
"string(FIND"
"target_include_directories"
"BUILDSYSTEM_TARGETS"
)
endif()
version_required_by(${_args})
-- Check version required: 2.6
...
-- Check version required: 2.8.5
-- string(FIND -> v2.8.5
...
-- Check version required: 2.8.11
-- target_include_directories -> v2.8.11
...
-- Check version required: 3.7
-- BUILDSYSTEM_TARGETS -> v3.7
cmake_minimum_required(VERSION 3.7 FATAL_ERROR)
> cmake -P CMakeLists.txt target_include_directories
-- Check version required: 2.6
...
-- Check version required: 2.8.11
-- target_include_directories -> v2.8.11
cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR)
关于cmake - 查找引入了哪个 CMake 版本的功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40844358/
在开始之前,我想指出的是,我已经通过Google进行了一次诚实而真实的搜索,涉及范围很广,无法找到。 我需要(对于我正在开发的项目)所有Delphi(从2007年到最新发布的版本,我不再支持任何早于2
我正在使用 RPM 将 Liquibase 数据库迁移添加到我们当前的产品部署中,并正在寻找一些有关如何实现我的预期目标的建议/技巧。 最好,RPM 能够安装在全新且 Shiny 的开发人员环境以及现
我目前正在使用一本书学习 UITableViewCell。为了在滚动时重用单元格,作者要求修改原始代码以包含一个if()。检查特定重用标识符的单元格是否存在的语句。但是,在添加 if() 之后语句,X
在 C++ 中引入 protected 访问说明符背后的基本原理是什么。举个例子会有帮助。 最佳答案 对于这类问题,我推荐 Bjarne Stroustrup 的The Design And Evol
我正在尝试使用模板参数中给定的维度和类型创建一个可重用的矩阵类。结构本身就是: template struct Matrix { T elements[N* M]; }; 当我尝试实现矩阵乘
我有一个简单的查询: $query1="SELECT * FROM wp_users WHERE now() < (last_login + INTERVAL 6 month)"; $resu
在 Ioke doc 中,ISpec 测试包含在文档中,参见 ioke.org/dok/index.html 这如何用 Ruby 的 RSpec 和 RDoc(或 SDoc)来完成?我找不到任何命令行
在客户端/服务器通信中,我看到来自客户端的 TCP ZeroWindow。 在这种情况之后预期的场景是什么(设置和发送什么标志)? 以下是我可能得到的日志。在这种情况下,服务器发送 RST 数据包来终
来自wikipedia关于 Lambda 函数和表达式的文章: users will often wish to define predicate functions near the place w
我有一个由父 POM 和几个子模块组成的 Maven 项目。它在 Intellij 中编译和运行良好(我假设它使用 javac 而不是 Maven)。 当我运行 maven clean install
所以我刚开始使用 d3.js,但我一直收到 JavaScript 错误,我不知道为什么。我刚刚用 svg 创建了三个圆圈,想用 d3 选择它们。这是我的代码:
Objective C 引入了一种称为 ARC 的技术,以将开发人员从内存管理的负担中解放出来。听起来不错,如果g++也有这个功能,我想C++开发者会很高兴的。 ARC allows you to p
在 package.json 添加 "font-awesome": "^4.7.0" 执行 npm install 在 main.js 引入
为什么 WSDL 引入 wsdl:message?和消息部分? 与在操作参数(输入、输出、故障)中直接使用 XSD 相比,他们可以带来什么优势? 它们(带有 wsdl 消息部分的 wsdl 消息)如何
I already read doc here : https://github.com/laravel/framework/pull/25997 我想知道的是使用 withCount()我们只是加载
我已经为此苦苦挣扎了一段时间,但不太明白发生了什么。我有一个包含 Sides(通常是 2 个)的 Card 实体 - 并且 Cards 和 Sides 都有一个 Stage。我正在使用 EF Code
下面的 swiftUI 代码在 iOS13 上运行良好,但是在使用 iOS14 进行测试时,我在尝试显示模式表时遇到了由强制解包选项引起的 fatal error 。据我所知,工作表不应该尝试为 se
出于个人原因,我需要记忆一下 jsp 上的一些事情 :) 我有一个简单的登录页面: Login First name:
据我了解,PYTHONCASEOK 选项允许通过不区分大小写的匹配来导入模块。但是,由于 python 中的几乎所有内容都区分大小写,为什么它必须启用此选项以实现更惰性的写入。 还有什么介绍的理由吗?
全新的早午餐(和 bower )。我通过 bower 安装了 Bootstrap,我有以下早午餐配置文件: exports.config = # See http://brunch.io/#doc
我是一名优秀的程序员,十分优秀!