【发布时间】:2017-01-29 07:39:19
【问题描述】:
我正在使用 ExternalProject_Add 包含一个外部项目。我想要的是能够做到
cmake -DCMAKE_CXX_COMPILER=<some compiler> <assume correct path>
用于顶级项目,以便我选择的编译器传播到外部包含的项目。我希望可以在 ExternalProject_Add 命令中添加一些内容:
ExternalProject_Add (
some_external_project
PREFIX ... # Assume this works.
GIT_REPOSITORY ... # Assume this works too.
# What should I write here to tell it to use the ${CMAKE_CXX_COMPILER}
# of the top-level project ?
)
【问题讨论】:
-
@Tsyvarev 谢谢。我找到了一个对我有用的简单解决方法,因此我将其发布以供快速参考。