rmake

0.0.1 • Public • Published

RMAKE - Rapid Testable C++ Project Creator

Description

RMake is a command line utility for creating C++ projects using CMake. It also creates a Test sub-project using Micro Test.

To use the rmake Ruby script

  1. On Linux add the following alias to your ~/.bachrc file (of course your path will be different).

    alias rmake='~/dev/rmake/rmake.rb'

    Note: I have rmake installed under my User path: ~/dev/rmake/

  2. On Windows you will need to edit the PATH environment variable and add the folder path to where rmake.rb is located.

Basic Usage

Let's go through the steps of creating a simple "hello" project using rmake.

Project "hello" Creation

The project is created under folder 'hello'.

cd /tmp
rmake hello

Building Project

Makefile is located under sub-folder build.

cd hello/build
make

Running hello program

The executable can be found under the build folder.

./hello

Running the Test Program

The test program is found under build/test/ sub-folder. Initially one failing test is created for you to follow.

./test/test.hello

Watch Video

Video

Micro Test - Testing Your Project

RMake creates a test sub-folder under src/ and uses the latest Micro Test header file, it basically pulls it from the Micro Test Git repository.

To learn more about how to write tests using Micro Test check out the project site. You will be amazed how simple and fast it is to write test code.

Importing Eclipse Project (Linux)

Launch Eclipse, then from the file menu select:

File -> New -> "Make project with existing code"

  1. Select Linux GCC for the toochain
  2. Browse to the existing project root
  3. Click finish

After the project is imported, from eclipse, right-click on the project name and pick "Properties" to bring up the project settings, or use the <Alt+Enter> shortcut.

Next click on "C/C++ Builds"

  1. Uncheck use default build command and type: "make VERBOSE=1"
  2. Click workspace button and select the folder "build" for this project
  3. Click OK

Next expand on "C/C++ General" and select "Path & Symbols"

  1. Click on the "Source Location" tab
  2. Click "Add Folder" button and select folder "src"
  3. Click OK

You should now be able to build and debug your C++ project.

Importing the Eclipse project (Windows & VC++)

Now we import our project into Eclipse. Launch Eclipse and from the file menu select:

File -> New -> "Make project with existing code"

  1. Select "Microsoft Visual C++" for the toochain
  2. browse to the existing project root
  3. click finish

We need to determine where the Include and Lib folder can be found. To do this from VC++ command prompt type:

echo %VSINSTALLDIR%
echo %WindowsSdkDir%

Once the project is imported, select it and right-click and pick "Properties" to bring up the project settings, or use the <Alt+Enter> shortcut.

  1. Select "C/C++ Build" -> "Settings"
  2. Click on "Linker" -> "Libraries"
  3. Under "Addtional libpath" click on the "+" icon
  4. Enter path to Lib folder, if should be something like
"C:\Program Files\Microsoft SDKs\Windows\v7.0A\Lib"
OR
"C:\Program Files\Microsoft Visual Studio 10.0\VC\lib"

Next expand on "C/C++ General" and select "Path & Symbols".

  1. Click on the "Source Location" tab
  2. Click "Add Folder" button and select "src" folder
  3. Click OK

We now need to excluse the build folder from the build process.

  1. Right click on the build folder
  2. Select "Resource Configurations" -> "Exclude from build".
  3. Select ALL and click OK

You should be able to build and run your project.

Thank You for using RMake, your support is very appreciated!

Happy Hacking =)


Contact

Rajinder Yadav

Labs DevMentor.org Corp.

Web: http://labs.devmentor.org

Email: info@devmentor.org

Package Sidebar

Install

npm i rmake

Weekly Downloads

1

Version

0.0.1

License

GPL-3.0

Last publish

Collaborators

  • rajinder.yadav