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
-
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/
-
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 /tmprmake hello
Building Project
Makefile is located under sub-folder build.
cd hello/buildmake
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
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"
- Select Linux GCC for the toochain
- Browse to the existing project root
- 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"
- Uncheck use default build command and type: "make VERBOSE=1"
- Click workspace button and select the folder "build" for this project
- Click OK
Next expand on "C/C++ General" and select "Path & Symbols"
- Click on the "Source Location" tab
- Click "Add Folder" button and select folder "src"
- 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"
- Select "Microsoft Visual C++" for the toochain
- browse to the existing project root
- 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.
- Select "C/C++ Build" -> "Settings"
- Click on "Linker" -> "Libraries"
- Under "Addtional libpath" click on the "+" icon
- 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".
- Click on the "Source Location" tab
- Click "Add Folder" button and select "src" folder
- Click OK
We now need to excluse the build folder from the build process.
- Right click on the build folder
- Select "Resource Configurations" -> "Exclude from build".
- 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