Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build: Support cmake --build

See original GitHub issue

As 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 {} to cmake --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:open
  • Created 8 years ago
  • Reactions:9
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

tlobigcommented, Jan 17, 2020

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?

qhdwightcommented, Jun 15, 2022

Ah thanks you @AlexisTM ! I will take a look and see if it would be possible to update and into a new PR.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found