Giter Club home page Giter Club logo

easybuild's Introduction

EasyBuild

Skeleton code for a project using cmake for building, gtest for testing, and gcov for coverage checking

This is meant to be a starting point for projects written in C/C++. It provides a directory structure and CMakeLists.txt files that set up some targets for testing with gtest and coverage checking with gcov. It took way too long to figure out how to integrate cmake, gtest, and gcov together, so creating a skeleton project for future use seemed like a good idea.

This is only compatible with OS X right now. It is far from complete.

Coverage checking with Clang requires some target libraries that probably aren't needed (or even exist) on Windows/Linux. Upgrading for other platforms will likely require some modifications to test/CMakeLists.txt and cmake/CodeCoverage.cmake.


To use:

  1. Download Google Test and unzip its contents into the gtest directory.

  2. Create a build directory in the project root called "build".

  3. cd into the build directory and type

$ cmake .. $ make

to build the current project.

  1. Modify the files in the src, include, and test directories to start coding your project.

  2. Update the CMakeLists.txt in the root directory to change the project name and sources.

  3. Goto 2.


The default settings assume that the standard build is an executable and not a library.

Compiler flags for the standard and test builds can be modified in the CMakeLists.txt files in the src and test directories. Commonly used flags are already included.

The unit tests do not use ctest, as it seemed to be mostly redundant with gtest. Instead, use the target

$make test

to run the tests generated by gtest.

In addition to the standard and test targets, this also contains a coverage target that can be built using

$make coverage

This will open up a browser window with code coverage results.

The target

$make install

will move the standard build binary into the root bin directory. It will not move the test binary.

easybuild's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.