[CMake] MSYS2 broken CMAKE_PREFIX_PATH

Mario Emmenlauer mario at emmenlauer.de
Sun Feb 11 09:13:14 EST 2018


I use mingw-w64-x86_64-cmake 3.10.2 on MSYS2. Generally it works well,
but just recently I started to have problems with CMAKE_PREFIX_PATH.
Its possible that the problems have been there forever, but I now just
found them due to a better use of CI systems.

The problem is that cmake is not finding package configuration files
correctly. I have such files in DESTDIR/lib/cmake, i.e. for a library
XXX there are typically files XXXConfig.cmake, XXXConfigVersion.cmake
and XXXTargets.cmake (i.e. for Qt, VTK and others).

But they are not found when I specify CMAKE_PREFIX_PATH=DESTDIR/lib/cmake
in Unix path style. It does work when I specify the package configuration
directory in Windows style! This makes things quite confusing, because many
find_xxx() commands for headers and libraries work with Unix paths. So now
I need to use CMAKE_PREFIX_PATH=UNIXDESTDIR for the normal find_xxx(), but
add WINDESTDIR\lib\cmake for the package configuration files (*).

Is this an MSYS2 issue or a standard cmake issue? I reported it with MSYS2
here https://github.com/Alexpux/MINGW-packages/issues/3337 in case someone
can comment?

All the best,

    Mario Emmenlauer


(*) UNIXDESTDIR is a shorthand of a path in Unix style, like /d/soft/
    WINDESTDIR is a shorthand of a path in Windows style, like D:\soft\


--
BioDataAnalysis GmbH, Mario Emmenlauer      Tel. Buero: +49-89-74677203
Balanstr. 43                   mailto: memmenlauer * biodataanalysis.de
D-81669 München                          http://www.biodataanalysis.de/


More information about the CMake mailing list