Skip to content

MacOS user build guidance

Rongzhen Chen edited this page May 29, 2020 · 17 revisions

Install necessary dependencies

1. Install Homebrew

2. Install gcc 9+ or Clang 10

  • gcc: brew install gcc
  • Clang: brew install llvm

3. Download Urho3D 1.7.1 Prebuilt

  • Unzip folder should be in the path where can be easily accessed later

Build the project with CLion

Guidance with images is available here :)

1. Config your toolchain for GCC and Clang in CLion preference

  • Preferences -> Build, Execution, Deployment -> Toolchains
  • Press the + sign
  • Select System in drop-down menu
  • Fill in config info:
    • Name: GNU GCC${GCC_VERSION} (Example: GNU GCC9)(Suggested)
    • C Compiler: GCC-${GCC_VERSION} (Example: gcc-9)
    • C++ Compiler: g++-${GCC_VERSION} (Example: g++-9)
  • For Clang, same step as above but different config info:
    • Name: Clang/LLVM10(Suggested)
    • C Compiler: /usr/local/opt/llvm/bin/clang
    • C++ Compiler: /usr/local/opt/llvm/bin/clang++
  • Click OK

2. Config CMake with your toolchains and Urho3D

  • Preferences -> Build, Execution, Deployment -> CMake
  • Press the + sign
  • Fill in config info:
    • Build type: Choose Debug
    • Name: Debug-GNU GCC${GCC_VERSION} (Suggested)
    • Toolchain: Choose GNU GCC${GCC_VERSION} (Or other name for GCC which been added in toolchains)
    • CMake options: -DURHO3D_HOME=<PathToYourUrho3Dsdk> (Example: -DURHO3D_HOME=/Users/Bob/Downloads/Urho3D-1.7.1)
  • For Clang, same step as above but different config info:
    • Build type: Choose Debug
    • Name: Debug-Clang/LLVM10 (Suggested)
    • Toolchain: Choose Clang/LLVM10 (Or other name for Clang which been added in toolchains)
    • CMake options: -DURHO3D_HOME=${PATH_TO_URHO3D} (Example: -DURHO3D_HOME=/Users/Bob/Downloads/Urho3D-1.7.1)
  • Click OK

3. Reload CMake project

  • Delete the cmake-build-${CMAKE_CONFIG_NAME} folders
  • Click CMake tab in the bottom
  • Click the first icon on the left side to reload CMake project

4. Build

  • Choose target
    • smartcar_emul for the emulator
    • Several Test target if you need them
  • Choose CMake config
    • Debug-GNU GCC${GCC_VERSION} or Debug-Clang/LLVM10
  • Click Build, Run or Debug