Search code examples
opencvmingw-w64msys2

Install libraries into MSYS2 from source


I have installed MSYS2 along with mingw64 on windows.

How do I install an application or library (in this case OpenCV) from the source code into mingw64 in the same way as pacman does, ideally using the CMAKE-GUI (due to a number of options to set)?

I have tried using

  1. Use CMake-Gui to generate a mingw-makefile, with an additional DCMAKE_INSTALL_PREFIX:PATH entry.
  2. Running mingw64 make installed
  3. The code compiles fine but then installing into the CMAKe build directory4
  4. MSYS pkg-manager can not see the library (opencv)

Solution

  • pacman for MSYS2 is an MSYS2 port of the ArchLinux package manager, pacman.

    To make an application or library installable "in the same way as pacman", and so that pacman can see it, you need to make a pacman package of it: here is the documentation