Skip to content

Instantly share code, notes, and snippets.

@imaami
Last active August 31, 2021 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imaami/c178d7fcd158dd4b2f7fab4883c2d0ed to your computer and use it in GitHub Desktop.
Save imaami/c178d7fcd158dd4b2f7fab4883c2d0ed to your computer and use it in GitHub Desktop.
Installing CMake for Windows in Wine without a GUI

Installing CMake for Windows in Wine without a GUI

Steps

  1. Set and export shell variables

    These variables are for our convenience:

    MYPREFIX=cmaketest
    CMAKEVER=3.17.3
    MSIFILE=cmake-$CMAKEVER-win64-x64.msi

    These are needed by winetricks and wine; they must be exported:

    export WINE_PREFIXES=/mnt/pfx
    export WINEARCH=win64
    export WINEPREFIX="$WINE_PREFIXES/$MYPREFIX"
  2. Create and configure a new wineprefix

    wineboot -i
    winetricks -q prefix=$MYPREFIX win10
  3. Download CMake

    wget https://github.com/Kitware/CMake/releases/download/v$CMAKEVER/$MSIFILE
  4. Install CMake

    wineconsole msiexec -i $MSIFILE -q ADD_CMAKE_TO_PATH=System

Relevant links

CMake download page

@leenapps
Copy link

leenapps commented Aug 31, 2021

Are you using cmake in wine?
I've found that it crashes if I use "MinGW Makefiles" as the build system but I've managed to get away with using "Ninja" for small projects
Also I'm not sure on how to go about silencing warnings for dlls or exes in the mingw/cmake path

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment