# How to update CMake version in BinaryBuilder's wizard

**URL:** <https://discourse.julialang.org/t/how-to-update-cmake-version-in-binarybuilders-wizard/109461>\
**Category:** Package Management\
**Tags:** question, binarybuilder\
**Created:** [January 30, 2024, 5:16pm UTC](https://discourse.julialang.org/t/how-to-update-cmake-version-in-binarybuilders-wizard/109461 "2024-01-30T17:16:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulVirally](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paulvirally/32/29911_2.png) [@PaulVirally](https://discourse.julialang.org/u/PaulVirally)\
**Post date:** [January 30, 2024, 5:16pm UTC](https://discourse.julialang.org/t/how-to-update-cmake-version-in-binarybuilders-wizard/109461/1 "2024-01-30T17:16:19Z")

</div>

I’ve been trying to [build a package](https://github.com/PaulVirally/VkFFTCUDA.jl) using BinaryBuilder. My package has a [binary dependency](https://github.com/PaulVirally/VkFFTCUDALib) that can be built with CMake. I need CMake version 3.18 because it has some CUDA definitions, but the CMake binary that I can use inside BinaryBuilder’s wizard is version 3.17.2. Is there any way to bump the version of CMake inside of the BinaryBuilder wizard, or do I have to modify my CMakelists.txt to make it work with 3.17.2?

For reference, I tried the following two compiler sets:

1. GCC 4.8.5 & LLVM 12.0.0
2. GCC 11.1.0 & LLVM 12.0.0

(I doubt that changing these will give different cmake versions but I still had to try…)

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 30, 2024, 5:25pm UTC](https://discourse.julialang.org/t/how-to-update-cmake-version-in-binarybuilders-wizard/109461/2 "2024-01-30T17:25:47Z")

</div>

Try adding [`CMake_jll`](https://github.com/JuliaBinaryWrappers/CMake_jll.jl) as a [`HostBuildDependency`](https://docs.binarybuilder.org/stable/build_tips/#Dependencies-for-the-target-system-vs-host-system):

```julia
HostBuildDependency(PackageSpec(; name="CMake_jll", version = v"3.28.1"))

```

From

> <https://github.com/JuliaPackaging/Yggdrasil/blob/54d529ad0e306d0e5d000f3bdd35a99cf55a015d/S/SuiteSparse/common.jl#L76>

Otherwise install the package from newer Alpine Linux repos:

```julia
apk add --upgrade cmake --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main

```

See for example

> <https://github.com/JuliaPackaging/Yggdrasil/blob/54d529ad0e306d0e5d000f3bdd35a99cf55a015d/G/GMAT/build_tarballs.jl#L17>

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [January 30, 2024, 5:32pm UTC](https://discourse.julialang.org/t/how-to-update-cmake-version-in-binarybuilders-wizard/109461/3 "2024-01-30T17:32:00Z")

</div>

@giordano Does the `CMake_jll` also require

```julia
script = raw"""
apk del cmake
...
"""

```

as in [Yggdrasil/S/SuiteSparse/SuiteSparse@7/build\_tarballs.j](https://github.com/JuliaPackaging/Yggdrasil/blob/54d529ad0e306d0e5d000f3bdd35a99cf55a015d/S/SuiteSparse/SuiteSparse%407/build_tarballs.jl)?

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [January 30, 2024, 5:40pm UTC](https://discourse.julialang.org/t/how-to-update-cmake-version-in-binarybuilders-wizard/109461/4 "2024-01-30T17:40:11Z")

</div>

Possibly, yes, because it looks like at the moment packages installed via `HostBuildDependency` don’t take precedence over system binaries:

> <https://github.com/JuliaPackaging/BinaryBuilderBase.jl/blob/a4ef056f979007f806ff3980dc6e592f9dd4dd1b/src/Runner.jl#L1206-L1209>

(system `PATH` is before `host_bindir`)
