build: Support cmake --build
See original GitHub issueAs mentioned in #266, the cmake
executable provides a --build
option in version 2.8 and later, which calls the native build tool to build a package (see documentation below). This will enable using other generators (Ninja, Xcode, etc) for CMak-based packages.
Instead of directly calling make
, we could use cmake --build
. If we did this, the abstraction should be clear in the catkin
command line interface. To do that, it might be necessary to change --make-args
and --catkin-make-args
to something that better reflects their generality.
This could be done in two three stages:
- 1. For CMake-based build jobs, change all direct invocations of
make {}
tocmake --build --use-stderr -- {}
. This would enable this as an “advanced” feature. - 2. Extract generator type from CMake
-G
option to control other features (e.g. disabling parallel packages). - 3. Update command-line interface to reflect the new advanced usage.
This supersedes #215.
cmake --build
--build <dir>
Build a CMake-generated project binary tree.
This abstracts a native build tool's command-line interface with the following options:
<dir> = Project binary directory to be built.
--target <tgt> = Build <tgt> instead of default targets.
--config <cfg> = For multi-configuration tools, choose <cfg>.
--clean-first = Build target 'clean' first, then build.
(To clean only, use --target 'clean'.)
--use-stderr = Don't merge stdout/stderr output and pass the
original stdout/stderr handles to the native
tool so it can use the capabilities of the
calling terminal (e.g. colored output).
-- = Pass remaining options to the native tool.
Run cmake --build with no options for quick help.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:9
- Comments:8 (5 by maintainers)
Top Results From Across the Web
CMake 3.25.1 Documentation
CMake may support multiple native build systems on certain platforms. A generator is responsible for generating a particular build system.
Read more >CMake projects in Visual Studio | Microsoft Learn
Visual Studio uses a CMake configuration file to drive CMake generation and build. CMakePresets.json is supported by Visual Studio 2019 version ...
Read more >Running CMake
Unless otherwise noted, you should always make a build directory and build from there. You can technically do an in-source build, but you'll...
Read more >Configure CMake - Android Developers
Create a CMake build script · Add NDK APIs · Add other prebuilt libraries · Include other CMake projects · Call CMake from...
Read more >Building with CMake - GitHub Pages
This will make a build directory ( -B ) if it does not exist, with the source directory defined as -S . CMake...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems like this issue was kinda forgotten. been using the _tools for a while and never knew that _make supported ninja already. Is there going to be any progress on this?
Ah thanks you @AlexisTM ! I will take a look and see if it would be possible to update and into a new PR.