使用CMake+Ninja使用GIT下载依赖项
Using CMake + Ninja to download dependencies using GIT
我有一个ExternalProject依赖项,它在构建过程中被克隆(使用git)。这一切都适用于CMake+Make。
mkdir build && cd build;
cmake ..
make
当我键入make时,它使用git正确地克隆和构建了库。
然而,当我使用忍者生成器时:
mkdir build && cd build;
cmake -GNinja ..
ninja
我得到以下错误:
$ 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?
Turns out if you do a clean before building, it all works and ninja does download my dependencies correctly.
So the workflow looks like this:
mkdir build && cd build
cmake -G Ninja ..
ninja clean # if you don't do this, it will not download Externalproject dependencies
ninja
忍者生成器中一定有某种bug,但我现在对这个工作流程很满意。
相关文章:
- C++ Windows 通知:使用依赖模板名称
- 更新 Visual Studio 2017,现在出现编译错误 C7510:"回调":使用依赖模板名称必须以 'template' 为前缀
- 现代编译器是否可以在使用依赖关系注入时取消虚拟化函数调用
- 是否可以在Qt设计器中使用依赖项注入(对于.ui文件)
- 我如何避免使用依赖于参数的查找明确专门化模板化功能
- clang libtooling-如何使用依赖关系
- 使用依赖于 "this" C++ 的比较结构初始化集合
- 在默认参数中使用依赖范围作为 std::less 的类型时出现编译错误
- 维护C++对象,使用依赖于UI的方法
- 重构Singleton/Globals以使用依赖注入进行单元测试
- 我需要一个框架来使用依赖项注入吗
- 如何在另一台电脑中使用依赖于Excel中的gsl dll的c++dll
- 如何在不使用依赖DLL的情况下运行该DLL
- 使用依赖项并行运行多个任务
- 找不到标识符,即使使用依赖于参数的查找和运算符<<也不明确
- 使用依赖于类的类型和函数,在类的所有实例中具有相同值的c++变量
- 在Python中使用依赖于已有库的SWIG为c++扩展使用CMake
- 我应该使用依赖注入或不为了有一个良好的设计和可测试的代码
- 使用依赖项交叉编译:如何在主机上获得目标依赖项
- 在Unity项目中使用依赖于另一个NDK构建的库时出错