CMake子项目中的覆盖选项 [英] Override option in CMake subproject
本文介绍了CMake子项目中的覆盖选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试重用我不想更改其来源的第三方项目的CMakeLists.txt
(
I'm trying to reuse the CMakeLists.txt
of a third-party project whose source I don't want to change (expat, to be exact). I've added the project as a subproject of the top level using add_subdirectory
.
这可行,但是现在我想在顶层CMakeLists.txt
中设置某些子项目option
的值.我该怎么做?
This works but now I would like to set the value of some of the subproject's option
s in the top level CMakeLists.txt
. How do I do this?
推荐答案
请参见简而言之:
SET(SOME_EXPAT_OPTION OFF CACHE BOOL "Use some expat option")
这篇关于CMake子项目中的覆盖选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文