Skip to content

Make CMake preset in Dockerfile a build-time variable #130

@baal-lgln

Description

@baal-lgln

Currently the Dockerfile builds roofer with the vcpkg-minimal CMake preset and the -DRF_USE_VAL3DITY=ON parameter.
Using an ARG variable in the Dockerfile would help us define the preset or the parameter at build time (e.g. to activate/deactivate val3dity for the build):

ARG BUILD_PRESET=vcpkg-minimal
ARG USE_VAL3DITY=ON

RUN --mount=target=$ROOFER_BUILD/vcpkg_installed,type=cache cmake \
    --preset $BUILD_PRESET \
    -DRF_USE_LOGGER_SPDLOG=ON \
    -DRF_BUILD_APPS=ON \
    -DRF_USE_VAL3DITY=$USE_VAL3DITY \
    -DCMAKE_INSTALL_PREFIX=$ROOFER_INSTALL \
    -S $ROOFER_ROOT \
    -B $ROOFER_BUILD \
    -G Ninja \
    && cmake --build $ROOFER_BUILD -j $JOBS --target install --config Release \
    && cp -r $ROOFER_BUILD/vcpkg_installed/x64-linux/share/gdal $ROOFER_INSTALL/gdal \
    && cp -r $ROOFER_BUILD/vcpkg_installed/x64-linux/share/proj $ROOFER_INSTALL/proj

Then a build could be started with vcpkg-full-test as a preset:
docker build --build-arg BUILD_PRESET=vcpkg-minimal --build-arg USE_VAL3DITY=OFF -t roofer:vcpkg-full-test .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions