Compiling - Mac OS X
1. Install Mac Developer Tools (Xcode)
2. Install Cmake. (If using the Mac package installer, click on "Install Link" to enable command-line access.
3. Install Glib2 and its dependencies.
4. Download and unpack OpenCPN source code
5. cd into the opencpn (top level) directory
6. Edit CMakeLists.txt and comment out the line (around 163) that reads "ADD_DEFINITIONS("`pkg-config --cflags --libs gtk+-2.0`") as clang doesn't like these options
7. mkdir build
8. cd build
9. cmake -G Xcode ../
10. Open Xcode and File->Open the OpenCPN.xcodeproj that should have been created in the build directory.
11. Select the "opencpn" active target & the "i386" active architecture.
12. Edit the source file tri.c and remove the 'inline' declaration from the function
13. Hit "Build & Run" There will be a series of warnings from wxWidgets which can be dismissed by clicking on "Cancel".
OSX - Lion (Work in progress)
- Install XCode from App Store
- download wxWidgets-2.9.3.tar.bz2
- open terminal and make a source directory:
- mkdir ~/src
- cd ~/src
- tar jxf ~/Downloads/wxWidgets-2.9.3.tar.bz2
- cd wxWidgets-2.9.3
- mkdir macbuild
- cd macbuild/
- ../configure --enable-unicode --enable-debug --disable-shared --with-osx_cocoa --with-macosx-sdk=/Developer/SDKs/MacOSX10.7.sdk --with-macosx-version-min=10.7
- make
- sudo make install
- Download gettext-0.18.1.1.tar.gz
- cd ~/src
- tar zxf ~/Downloads/gettext-0.18.1.1.tar
- cd gettext-0.18.1.1/
- You need to patch gettext for Lion. Edit the file gettext-tools/gnulib-lib/stpncpy.c to add "#undef stpncpy" just before "#ifndef weak_alias". vim ../gettext-tools/gnulib-lib/stpncpy.c
- mkdir build_macos
- cd build_macos/
- ../configure
- make
- sudo make install
- Clone the OpenCPN source.
- Fix some code issues with 2.9.4... git remote add balp git@github.com:balp/OpenCPN.git ; git fetch --all ; git checkout balp/mac_osx_lion
- ./build_mac.sh