首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用CMake + Ninja下载依赖项

使用CMake + Ninja下载依赖项
EN

Stack Overflow用户
提问于 2014-10-29 03:37:01
回答 1查看 1.1K关注 0票数 3

我有一个ExternalProject依赖项,它在构建过程中被克隆(使用git)。对于CMake + Make,这一切都很好。

代码语言:javascript
复制
mkdir build && cd build; 
cmake ..
make

当我键入make时,它将正确地克隆和构建使用git的库。

但是,当我使用忍者生成器时:

代码语言:javascript
复制
mkdir build && cd build; 
cmake -GNinja ..
ninja

我得到以下错误:

代码语言:javascript
复制
$ cmake -GNinja ..                                                                                                                                                                                                                                                   -- The C compiler identification is AppleClang 6.0.0.6000054
-- The CXX compiler identification is AppleClang 6.0.0.6000054
-- Check for working C compiler using: Ninja
-- Check for working C compiler using: Ninja -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler using: Ninja
-- Check for working CXX compiler using: Ninja -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.56.0
-- Found the following Boost libraries:
--   unit_test_framework
-- Found Git: /usr/local/bin/git (found version "2.1.2")
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/carneiro/src/gamgee/build

$ ninja
ninja: error: 'contrib/htslib-prefix/src/htslib/libhts.a', needed by 'test/gamgee_test', missing and no known rule to make it


Is git downloading of external projects not supported by the cmake+ninja combo?
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-11-02 16:51:02

事实证明,如果您在构建之前进行了清理,则所有这些操作都会正常工作,而忍者确实正确地下载了我的依赖项。

工作流程如下所示:

代码语言:javascript
复制
mkdir build && cd build
cmake -G Ninja ..
ninja clean  # if you don't do this, it will not download Externalproject dependencies
ninja

一定是Ninja生成器中的某种bug,但我现在对这个工作流很满意。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26622394

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档