[CMake] MSYS2 broken CMAKE_PREFIX_PATH

Mario Emmenlauer mario at emmenlauer.de
Mon Feb 12 17:06:49 EST 2018


Dear Alan,

On 12.02.2018 22:09, Alan W. Irwin wrote:
> On 2018-02-12 13:06+0100 Mario Emmenlauer wrote:
> 
>>
>> Hi,
>>
>> ok I agree it might be cleaner to use Windows-style paths for all
>> cmake parameters on MSYS2. I changed my CI and everything works! :-)
>>
>> But just as a side comment: It would be super cool if cmake would
>> support both styles for all parameters. The typical use on MSYS2 for
>> many commands is with Unix paths, and its great that cmake already
>> supports this so nicely. It really made things easier for me!
>>
>> If its not a huge effort it would be great to have the same behaviour
>> also for the package configs.
> 
> I am glad you have found a satisfactory solution for your needs, but I
> would like to respond to your further side comment about the broader
> picture.
> 
> I am virtually positive from reading
> <https://github.com/msys2/msys2/wiki/MSYS2-introduction> and other
> MinGW-w64/MSYS2 documentation that the conversion from POSIX to native
> PATHs is done by the MSYS2 dll.  Also, MinGW-w64/MSYS2 applications
> from the msys2 repository are linked against that dll while the
> applications from the mingw64 repository are pure native, i.e., not
> linked against that dll.  Thus, if that mental model is correct, here
> are some predictions that flow from it.
> 
> * The cmake version from the msys2 repository will understand cache
> variables expressed as POSIX PATHs, but the cmake version from the
> mingw64 repository wont have that capability.

I am not sure if I follow until here, but very likely I just misunderstand
what you are saying. Please help shed some light! In my observation, I
have cmake installed from mingw64 repository, and I can successfully use
this cmake with a CMAKE_PREFIX_PATH in POSIX PATH notation, as long as I
find all my dependencies with find_xxx() commands (i.e. find_library() or
find_file() or the like). I also use this same cmake with a path to the
source directory specified as POSIX PATH.

So to be 150% sure we mean the same, the following works for me, where
/d/ corresponds to the D: drive of Windows:
    /mingw64/bin/cmake /d/tmp/sources \
        -DCMAKE_PREFIX_PATH="/d/dest/thirdparty;/d/dest/binaries" && \
    make && make install

Is that contradictory to your point above?

Cheers,

    Mario Emmenlauer


--
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