build.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #! /bin/bash
  2. # build.sh/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
  3. # This copyright was auto-generated on Tue Feb 8 01:22:35 UTC 2022
  4. set -e
  5. cd "$(dirname "$0")"
  6. # Verify Prerequisites
  7. if ! command -v cmake &>/dev/null; then
  8. echo "cmake can not be found."
  9. echo "Please install: https://cmake.org/install/"
  10. exit
  11. fi
  12. CONAN="python3 -m conans.conan"
  13. if ! $CONAN --version &>/dev/null; then
  14. echo "conan can not be found."
  15. if ! command -v python3 &>/dev/null; then
  16. echo "Please install: https://docs.conan.io/en/latest/installation.html"
  17. exit
  18. else
  19. echo "Trying to install conan with discovered python3"
  20. pip3 install conan
  21. fi
  22. fi
  23. # Install Conan packages
  24. mkdir -p build
  25. cd build
  26. $CONAN install .. --build=missing
  27. if [ "$(uname)" == "Darwin" ]; then
  28. cmake -DCMAKE_BUILD_TYPE=Release ..
  29. elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
  30. cmake -DCMAKE_BUILD_TYPE=Release ..
  31. else # Windows. Force to 64 bit.
  32. cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_GENERATOR_PLATFORM=x64 ..
  33. fi
  34. cmake --build . --config Release