Giter Club home page Giter Club logo

allegrotestproject's Introduction

This is a simple test project that provides a basic boilerplate
template for git/cmake/allegro projects

The main files you need to know about are:
CMakeLists.txt
src/test.cpp
data/test.png
.gitignore

these are actually the only ones that I created myself. 
the rest are created automatically by CMake and git.

To get up and running, run:
cd build && cmake .. && make clean && make && sudo make install && altest

Alternately, you can just run each of those commands one after the other like so:
cd build
cmake ..
make clean
make
sudo make install
altest

NEVER RUN ANY OF THESE COMMANDS AS ROOT EXCEPT FOR THE MAKE INSTALL
in fact, you can even configure it to install to your home directory so you don't need to be root
for that either, really. That is SLIGHTLY more advanced, though...
Also, at this time, cmake does not make an 'uninstall' make target, and I don't know the RIGHT(tm)
way to do that. For right now, though, if you want to uninstall, you can look in install_manifest.txt
for a list of files which were installed, and just remove those files.

First, I created a git project by running:
git init

after that, I needed to give it a little more information:
git config --global user.email="[email protected]"
git config --global user.name="C. Mitch Carroll"

Obviously, you should substitute these for your own contact info.

these are necessary for you to be able to commit changes to
the project. After that, I made a file called .gitignore 
that has a simple list of file types for git to ignore
(hence the name).
once that's done, all that's left to get git set up is to
make an initial commit:
git add -A
git commit

the first command adds all changes to the staging area, and 
the second commits them, but first it opens a nano editor so 
you can add a comment to the commit. You should do these two 
steps early and often. This is the best way of being able to 
undo mistakes, and get things back to a known working state.
It also gives you a nice history of what's been done, and by whom.
sort of like saving a game.

next, I made a couple of directories: data and src
I made a simple test image called test.png, and put it in data,
and then made a simple test program and put it in the src directory.

once again, at this point one should run:
git add -A
git commit

The last part is to put together our build system and installer
I created a text file in the root project directory called
CMakeLists.txt and ran the following command FROM INSIDE THE build DIRECTORY:
cmake ..

This installs all of the necessary build files, and creates a makefile.

Note that the build commands are run from inside the build directory, but refer
to the project root directory. This way, all files generated by cmake or the
build process are all contained in the build directory. This way, it's easy to
sort out which files shouldn't be edited (those in build). This also gives a
handy way to return the project to a pristine state (e.g.: for packaging)
by simply emptying out the build directory.

Once again, from the project's root directory:
git add -A && git commit

now, to actually build and install, all we do is (from inside the build directory):
make
sudo make install

make sure not to ever run make itself as root; only make install


For more detailed information, you will need to read the comments in 
CMakeLists.txt and src/test.cpp.

Or, you know, do some research...

allegrotestproject's People

Contributors

mitchcarroll avatar

Watchers

James Cloos avatar  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.