天道酬勤,学无止境

meson-build

MesonBuild: How to define dependency to a library that cannot be found by `pkg-config`?

My project (in C) has a third party dependency at build time. But the third party library is, by default, installed to /opt/ instead of /lib, and I cannot find it in pkg-config. From mesonbuild's documentation, should I use declare_dependency, I don't have its source code to treat it as my sub-project. If I use dependency() to define it, I can't find the correct argument to define a customized location. How to declare dependency for a non-standard third party library?

2021-06-01 15:43:33    分类:问答    c   dependencies   meson-build

'cmake rebuild_cache'仅用于子目录?('cmake rebuild_cache' for *just* a subdirectory?)

问题 我有一个问题,即CMake的makefile生成阶段很慢,这类似于以下未解决的问题: CMake生成文件的速度很慢 我的项目由顶层CMakeLists.txt文件组成,该文件使用add_subdirectory()为单个库和可执行组件添加各种子项目。 对于给定的组件, CMakeLists.txt文件包含以下内容: add_library(mylib SHARED sourceFile1.cpp sourceFile2.cpp ... ) 我可以使用以下命令构建该目录的内容: make mylib 如果我修改CMakeLists.txt在子目录中的文件(我已经做了很多从纯粹的Makefile向CMake迁移的一部分),然后运行make它正确地重新运行CMake的更新配置,如果我” d运行make rebuild_cache 。 但是,我注意到它实际上重新配置了整个项目。 我真的希望CMake足够聪明,以便知道它只需要在当前目录和子目录中重新生成Makefile。 有没有更好的方法来构建CMake项目来实现这一目标? 我看到有人在每个子项目中为每个CMakeLists.txt使用project() 。 总的来说,这是个好主意吗? 另外/是否有某种方法可以加快CMake的生成步骤? (目前我有60多岁) 如果您想讨论为什么CMake本身应该或不应该能够并行运行(想想cmake

2021-05-09 01:39:19    分类:技术分享    build   cmake   build-process   meson-build

'cmake rebuild_cache' for *just* a subdirectory?

I have an issue with the generation of makefiles stage of CMake being slow which is similar to this unanswered question: CMake is slow to generate makefiles My project is made up of a top level CMakeLists.txt file which uses add_subdirectory() to add various subprojects for individual library and executable components. For a given component, the CMakeLists.txt file contains something like: add_library(mylib SHARED sourceFile1.cpp sourceFile2.cpp ... ) I can build just the contents of that directory using: make mylib If I modify the CMakeLists.txt file in the sub-directory (which I've been

2021-04-16 06:51:25    分类:问答    build   cmake   build-process   meson-build