Xcode for developing Geant4
Let try to compile examples/novice/N04 with Xcode
(maybe there is something more easy)
- Open Xcode (:))
- Select New Project from file menu and select External Build System
- Select your project Name: XcodeN04 for example and give
- Open the disclosure triangle beside the XcodeN04 (left side)
drag the folder containing the sources files src (Tell Xcode not to copy files) - From the Project Menu choose New Target and select Shell Script Target
and give a name Xenv.sh (for example) and close the pop up window - Open the disclosure triangle beside Xenv.sh and double click on Run Script
- Add those following line between #shell script… and exit 0 :
- From the Project Menu Set Active Target select the name of your script
file here Xenv.sh
the path where the example is installed (for me /Applications/geant4.8.3/examples/novice/N04/)
# shell script goes here
source $G4INSTALL/env.sh
make
exit 0
(give the full path of $G4INSTALL)
you can build now, it should work …