Installation

To build the Fortran shared library directly, use CMake version 3.5 or later. By default, the CMAKE_INSTALL_PREFIX will install the package into /usr/local/. For a more temporary install location, -DCMAKE_INSTALL_PREFIX:PATH can be provided at build time.

$ SRC_DIR="src/fortran/"
$ BUILD_DIR=".../libbezier-release/build"
$ INSTALL_PREFIX=".../libbezier-release/usr"
$ mkdir -p "${BUILD_DIR}"
$ cmake \
>     -DCMAKE_BUILD_TYPE=Release \
>     -DCMAKE_INSTALL_PREFIX:PATH="${INSTALL_PREFIX}" \
>     -S "${SRC_DIR}" \
>     -B "${BUILD_DIR}"
$ cmake \
>     --build "${BUILD_DIR}" \
>     --config Release \
>     --target install

Note that this will require having a full checkout of the Fortran source code (in SRC_DIR).

Installed Artifacts

Once installed, the libbezier library will come with a shared library for linking and C headers.

Linux

>>> print_tree(install_prefix)
usr/
  include/
    bezier/
      curve.h
      curve_intersection.h
      helpers.h
      status.h
      triangle.h
      triangle_intersection.h
    bezier.h
  lib/
    libbezier.so -> libbezier.so.2024
    libbezier.so.2024 -> libbezier.so.2024.6.20
    libbezier.so.2024.6.20
  share/
    bezier/
      cmake/
        BezierConfig-release.cmake
        BezierConfig.cmake

macOS

>>> print_tree(install_prefix)
usr/
  include/
    bezier/
      curve.h
      curve_intersection.h
      helpers.h
      status.h
      triangle.h
      triangle_intersection.h
    bezier.h
  lib/
    libbezier.2024.6.20.dylib
    libbezier.2024.dylib -> libbezier.2024.6.20.dylib
    libbezier.dylib -> libbezier.2024.dylib
  share/
    bezier/
      cmake/
        BezierConfig-release.cmake
        BezierConfig.cmake

Windows

>>> print_tree(install_prefix)
usr\
  bin\
    bezier.dll
  include\
    bezier\
      curve.h
      curve_intersection.h
      helpers.h
      status.h
      triangle.h
      triangle_intersection.h
    bezier.h
  lib\
    bezier.lib
  share\
    bezier\
      cmake\
        BezierConfig-release.cmake
        BezierConfig.cmake