Setting up the CppND-Route-Planning-Project on Mac
I recently started the CPP Nanodegree from Udacity and I must I am loving the course. Its a very comprehensive and well laid-out course that focuses both of the theoretical as well as practical aspects of learning a new language. Two things I especially like about the course are the snippets of Bjarne Stroustrup giving some insights into the ideas behind the features of the language and also the Projects. Udacity kudos to you!!
For 1st course of the Nanodegree, I was able to finish submitting the project via the online workspace itself but I thought it was best to setup this up locally as well so that I can code the same thing again at ease to be able to revise whatever has been learnt.
Here is a dummy’s guide to setup the CppND-Route-Planning-Project on your MacBook Pro.
Machine Details:
I am using a MacBook Pro with macOS Catalina (10.15.3).
The XCode Version is XCode 11.3.1
- Clone the repo from github: https://github.com/udacity/CppND-Route-Planning-Project , make sure to recursively update all the submodules for the same. We will refer to this as the main project.
- Clone the io2D repo into the thirdparty folder of the main project. https://github.com/cpp-io2d/P0267_RefImpl
- Download the extra C++ standard library headers from https://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz
- Extract them and place them in the thirdparty folder.
- Export the following flags to make the libraries placed in step 4 to be available to the io2D project:
export CXXFLAGS="-nostdinc++ -isystem<main project path>/CppND-Route-Planning-Project/thirdparty/clang/include/c++/v1"export LDFLAGS="$LDFLAGS -L/opt/X11/lib -L/opt/local/lib -L/usr/local/lib"export LDFLAGS="-L<main project path>/CppND-Route-Planning-Project/thirdparty/clang/lib -Wl,-rpath,<main project path>/CppND-Route-Planning-Project/thirdparty/clang/lib"
6. Install Brew
7. Install libpng: brew install libpng
8. Install cmake: brew install cmake
9. Generate the io2d XCodeProject
mkdir Debug
cd Debug
cmake -G "Xcode" --config Debug "-DCMAKE_BUILD_TYPE=Debug" -DIO2D_DEFAULT=COREGRAPHICS_MAC ../.
open io2d.xcodeproj
10. Open the io2d.xcodeproj file in XCode and run the same.
11. Cmake and Make the actual CppND-Route-Planning-Project as you would normally do in the online workspace.