when working on the HandsOn2 you will see that the notes for the tutorial are hosted at SLAC with rather "generic" instructions. I have translated them into 'iridium-able' commands ;-)
======================================================================================
BLOCK 1 getting the exercise code
======================================================================================
$ mkdir ~/HandsOn2 # make new working directory
$ cd ~/HandsOn2 # change to your new working directory
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn2/HandsOn2.tar.gz
$ wget http://geant4.slac.stanford.edu/SLACG4TutorialHandsOn/HandsOn2/HandsOn2-solution.tar.gz
$ tar xzf HandsOn2.tar.gz # extract source code
# optionally extract in a similar way the solution. But please give the exercise a try first ;-)
$ cd HandsOn2 # change to newly extracted code
$ ls # have a look at the files
$ cd .. # let's go back to '~/HandsOn2' working directory
===================================================================================
and
===================================================================================
BLOCK 2 OPTION: SEPARATE build and source directory
===================================================================================
$ mkdir build-HandsOn2
$ cd build-HandsOn2
$ cmake ../HandsOn2
$ make
$ ./SLACtut
===================================================================================
RINSE AND REPEAT
===================================================================================
# ... modify files located under '~/HandsOn2/HandsOn2'
# compile the code at ~/HandsOn2/build-HandsOn2
$ make
# when you issued 'cmake ../HandsOn2' those two folders got linked. It would just work
===================================================================================
OR
===================================================================================
BLOCK 2 OPTION: SAME build and source directory
===================================================================================
$ cd HandsOn2
$ cmake .
$ make -f Makefile
$ ./SLACtut
===================================================================================
RINSE AND REPEAT
===================================================================================
# ... modify files located under '~/HandsOn2/HandsOn2'
# compile the code directly at ~/HandsOn2/HandsOn2
$ make -f Makefile
===================================================================================
Happy coding ;-)