Compiling with biicode: CMake, build process, IDEs and more

biicode knows how source code files connect to each other. With this information, it creates a boilerplate CMake layout to build your project automatically. biicode then detects how sources connect and builds a dependency graph following #includes and implementations generating, for each block, a CMakeLists.txt defining variables to the dependency graph detected.

This translates into a CMakeLists.txt file with just one line by default:

Even though the boilerplate might be enough for some projects, here’s a guide to fully control the building process.

Today, we explain the different options available in biicode once you’ve got your CMakeLists.txt ready.

Compiling with biicode

Compiling with biicode

bii configure or bii build commands generate a CMakeLists.txt file in each block. Both commands accept CMake directives. For example, you can switch between building with gcc or clang just by running:

or

You can also choose the build type:

Possible values are: DEBUG, RELEASE, RELWITHDEBINFO and MINSIZEREL.

You can build your projects with the parameters CMake offers depending on your OS.

IDEs

By default, biicode configures projects with no IDE. Using MinGW in Windows UNIX Makefiles in MacOS and Linux. But you can use CMake generators to create biicode projects for different IDEs and platforms.

A CMake Generator is responsible for writing the input files for a native build system. Exactly one of the CMake Generators must be selected for a build tree to determine what native build system is to be used. CMake Generators are platform-specific so each may be available only on certain platforms.

Execute cmake --help to see the full list of CMake generators available in your system:

Let’s get into specifics using generators available for common IDEs:

Eclipse CDT

Linux/Mac OSX users:

If you are using Eclipse with Mac OS X, you may need some additional setup to execute your binaries within this IDE. Read this troubleshooting section for more information.

Windows users:

And once done, you can  import your project into Eclipse:

  1. Choose: File > import…
  2. Now, general > Existing Projects into Workspace > next.
  3. Select the root directory as the root folder of your project.
  4. You should see a project already selected in the projects box. Click finish.

Visual Studio

Generate a Microsoft Visual Studio 12 (2013) project:

Open your project with Visual Studio. Just double-click on the .sln file inside the build folder of your project and a VS project opens.

CLion

CLion’s compatibility is way easier, just get into your project’s folder and execute:

Configure your project to set the changes:

Open the biicode project with CLion (File -> Open).

And use biicode’s commands from the embedded Terminal in CLion, open it with: Alt+F12 or View -> Tool Windows -> Terminal.

Your turn

There are many options available, even some we haven’t tried yet, give it a try and tell us how you use biicode, we’re waiting forward to hear from you!

Some biicoders are hacking around already:

 

As always, we’re available at our forum or Stackoverflow tag. You can also write us and request features at our roadmap.


Related Posts