天道酬勤,学无止境

build-system

Modern CMake transitive Dependency not found

I am currently working on implementing a ROS library into our company software stack. Because the library is based on ROS and thus uses catkin I am rewriting the library to use cmake exclusively and try to apply the modern CMake approach. The library is structured as follows: . |-- CMakeLists.txt |-- LICENSE |-- README.md |-- grid_map_core | |-- CHANGELOG.rst | |-- CMakeLists.txt | |-- cmake | | `-- grid_map_core-extras.cmake | |-- grid_map_coreConfig.cmake | |-- include | | `-- grid_map_core | | `-- iterators | |-- src | | `-- iterators | `-- test If I install the library and try to add the

2021-06-27 19:12:03    分类:问答    cmake   build-system

Autotools、Cmake 和 Scons 之间有什么区别?(What are the differences between Autotools, Cmake and Scons?)

问题 Autotools、Cmake 和 Scons 之间有什么区别? 回答1 事实上,Autotools 唯一真正的“救命稻草”是所有 GNU 项目都在大量使用它。 Autotools 的问题: 真正的 ARCANE m4 宏语法与冗长、扭曲的 shell 脚本相结合,用于测试“兼容性”等。 如果你不注意,你会搞砸交叉编译能力(应该清楚地注意到,诺基亚提出了 Scratchbox/Scratchbox2 来回避用于 Maemo/Meego 的高度损坏的 Autotools 构建设置。)如果你,对于任何原因,在您的测试中有固定的静态路径,您将破坏交叉编译支持,因为它不会遵守您的 sysroot 规范,并且会从您的主机系统中提取内容。 如果您破坏了交叉编译支持,它会使您的代码无法用于 OpenEmbedded 之类的东西,并使试图在交叉编译器而不是目标上构建其版本的发行版变得“有趣”。 测试是否与古老,破碎的编译器的问题,没有人目前正在与几乎任何生产这个时代使用的数额巨大。 除非您在真正古老的 Solaris、AIX 或类似版本上构建 glibc、libstdc++ 或 GCC 之类的东西,否则这些测试是在浪费时间,并且会导致许多上述问题的潜在破坏。 获得 Autotools 设置来为 Windows 系统构建可用代码几乎是一种痛苦的经历。 (虽然我很少使用 Windows

2021-06-26 00:14:54    分类:技术分享    build   cmake   scons   autotools   build-system

How do I force a target to be rebuilt if a variable is set?

Assume I have a build-target foo: foo:foo.c $(CC) $(CFLAGS) $(ARGS) -c foo.c -o foo Now, ARGS is something that I pass on the command line: $ make ARGS:=-DX=1 foo So, I need to bypass make's cleverness, because the foo target does not only depend on which files have changed, but also on the value of ARGS. Is there something in make to do this? My hack (see answer) doesn't seem to be the most elegant but it works. Anything better?

2021-06-14 17:50:29    分类:问答    makefile   command-line-arguments   build-system

How to create Sublime Text 3 build system which reads shebang

How can I create a build system in Sublime Text 3 where "cmd" is replaced with a shebang if it exists? More specifically, is there a way to alter the Python build system to use the version of Python specified in the shebang, and use a default if no shebang is present?

2021-06-11 07:41:41    分类:问答    sublimetext3   shebang   build-system

A good strategy for implementing a versioning system

I have been struggling with versioning software for a while now. I'm not talking about a naming convention, I'm talking about how to actually apply a version in a build system all the way through to a release. I generally use major.minor.maintenance-[release type] i.e. 1.0.2-rc1 The problem is managing the version number. I've tried many ways (sticking it in a build file, a properties file, a database, etc,etc) but I haven't found anything that really works well. The closest thing I came up with is using Jira which I documented here: http://blog.sysbliss.com/uncategorized/release-management

2021-06-10 06:55:45    分类:问答    versioning   build-system

npm git存储库未更新版本(npm git repository not updating versions)

问题 我有一个 git repo,我正在尝试将它设置为我的项目中的依赖项。 使用 NPM,我的package.json看起来像这样: "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-connect": "~0.2.0", "grunt-contrib-watch": "~0.3.1", "custom": "git://github.com/myGitHubRepo/repo.js.git#b7d53a0cfbe496ad89bde6f22324219d098dedb3", "grunt-contrib-copy": "~0.4.0" } 在第一 npm install 它安装所有内容并毫无问题地获取存储库。 但是如果我改变这个提交哈希让我们说 "custom": "git://github.com/myGitHubRepo/repo.js.git#d6da3a0...", // a different one 它不更新! 谁能指出我怎么会得到这种行为? 我只是想分享这段代码,并且能够在某个时候更改这个版本, npm会自动更新它。 回答1 好的,这就是它的完成方式。 我也很困惑。 所以我在 git@github.com:myModule/MySweetModule.git 有一个私有的 npm 模块

2021-06-09 21:32:56    分类:技术分享    javascript   node.js   configuration   npm   build-system

Configure Sublime Text build system for Scala?

I'm trying to configure a build system for Scala with SublimeText, but I am having some difficulty. I have tried both of the following: { "shell_cmd": "scala", "working_dir": "${project_path:${folder}}", "selector": "source.scala" } { "cmd": ["/path/to/bin/scala", "$file_name"], "working_dir": "${project_path:${folder}}", "selector": "source.scala", "shell": true } Both of these attempts produce the same failed output - it seems to start up the interactive Scala shell rather than running my script. Any advice?

2021-06-09 17:32:10    分类:问答    scala   sublimetext3   build-system

如何在不再次运行配置脚本/cmake 的情况下修改安装路径(how to modify the install-path without running the configure script/cmake again)

问题 我正在做一个需要相当长的时间来构建 (10-15) 分钟的项目。 我已经重新编译以验证是否存在编译错误。 现在我想更改安装目录,以便我有一个带有新更改的新版本的可执行文件。 有没有一种方法可以只修改安装路径,以便“make install”安装到新位置而不是旧位置? 回答1 CMake 生成的 makefile 支持 makefile 的 DESTDIR 编码约定。 因此,您可以通过在调用 make 时设置DESTDIR变量来覆盖默认安装位置: $ make install DESTDIR=/opt/local 无需重新运行 CMake。 回答2 我不知道这是否通常是真的,但我可以举一个应用程序的例子, sakra接受的答案不能正常工作。 如果在安装 ITK 时通过修改DESTDIR来修改安装目录,它只会将DESTDIR附加到其已经形成的安装路径: make install DESTDIR=/opt/local [...] -- Installing: /opt/local/usr/local/lib/cmake/ITK-4.4/WrapITK/Configuration/Typedefs/itkRenyiEntropy[...] 另一方面,按照Fraser这个回答将导致正确的安装路径而无需重新编译: cmake -DCMAKE_INSTALL_PREFIX=/opt

2021-06-05 02:42:57    分类:技术分享    makefile   cmake   configure   build-system

Macro definitions for headers, where to put them?

When defining macros that headers rely on, such as _FILE_OFFSET_BITS, FUSE_USE_VERSION, _GNU_SOURCE among others, where is the best place to put them? Some possibilities I've considered include At the top of the any source files that rely on definitions exposed by headers included in that file Immediately before the include for the relevant header(s) Define at the CPPFLAGS level via the compiler? (such as -D_FILE_OFFSET_BITS=64) for the: Entire source repo The whole project Just the sources that require it In project headers, which should also include those relevant headers to which the macros

2021-06-04 17:14:32    分类:问答    c   macros   header   autotools   build-system

How to show result of python script in a console when running from ST editor?

I'm new to Sublime Text so am unfamiliar with its internals so far. From what I could tell the problem could be something related to this. I have a python script var = raw_input("Enter something: ") print "You entered ", var which asks for input, waits for it, then prints it out in windows console prompt. How do I make ST3 upon "building" to show the results in a console window?

2021-06-02 11:11:13    分类:问答    python   windows-7   sublimetext   sublimetext3   build-system