Somehow the mingw pkg-config latches into the environment while the msys
version
doesn't. When I put the mingw version in that (/usr/bin)slot, it does the
right/helpful thing.  This is either a deficiency or deliberate aspect of
msys/pkg-config.exe.

Finding msys64/mingw64/pkg-config.exe:
CMAKE_PREFIX_PATH is a last-ditch default search prefix used in
find_path (with /include) or find_library(with /lib) or find_program( /bin)
after much else has failed. CMAKE does use CMAKE_PROGRAM_PATH to find the
program and I did set that, which is (one reason) why it chose
/usr/bin/pkg-config to execute.  Then it goes through more possibilities
which have higher priority than using
HINTS ENV PATH which didn't override them.
 I was also setting CMAKE_PREFIX_PATH to /usr:/usr/local so it found that,
also.
When I blanked out PREFIX_PATH,even if I put NO_DEFAULT_PATH in the
find_program call, it didn't take the HINTS.

To find my libraries I augment CMAKE_LIBRARY_PATH and CMAKE_INCLUDE_PATH in
Platform/Mingw.cmake with custom code.  I
did set up PREFIX_PATH to be /usr/:/usr/local, then start off LIBRARY_PATH
and INCLUDE_PATH using PREFIX.

Here is the CMAKE debug output of what I'm talking about:
======

 CMakeDetermineSystem> uname -s

MINGW64_NT-6.1 2.0.0(0.280/5/3)

The C compiler identification is GNU 4.9.2

check for MINGW64 on C:/msys64/usr/../

MINGWPATH= () MSYS_USR_PATH= C:/msys64/usr

Platform/libpaths: inspecting PKG_CONFIG_PATH: (2 paths)

Platform/libpaths: inspecting LIBRARY_PATHS: (2 paths)

Platform/libpaths: inspecting LDFLAGS: -LC:/msys64/mingw64/lib
-LC:/mingw/opt/lib64

<Platform/libpaths>(LDFLAGS) C:/msys64/mingw64/lib already in library search

<Platform/libpaths>(LDFLAGS) C:/mingw/opt/lib64 already in library search

CMAKE_LIBRARY_PATH:

C:/msys64/mingw64/lib;C:/mingw/opt/lib64;C:/msys64/usr/local/lib;C:/msys64/usr/lib

CMAKE_INCLUDE_PATH:

C:/msys64/mingw64/include;C:/mingw/opt/include;C:/msys64/usr/local/include;C:/msys64/usr/include

CMAKE_PREFIX_PATH:

[blank]
=====
further down, {plplot/...}pkg-config.cmake calling FindpkgConfig.make
pkg-config:
===============
 LIB_DIR= C:/Program Files (x86)/plplot/lib

-- -- pkg_check_modules compiled -- -- --

PKG_CONFIG_FOUND ? TRUE

PKG_CONFIG_EXECUTABLE ? C:/msys64/mingw64/bin/pkg-config.exe

(0) execute: C:/msys64/mingw64/bin/pkg-config.exe --version

0.28

 (0): C:/msys64/mingw64/bin/pkg-config.exe --libs pango

-LC:/msys64/mingw64/lib -lpango-1.0 -lm -lgobject-2.0 -lglib-2.0 -lintl


On Thu, Nov 20, 2014 at 12:01 PM, Wayne Stambaugh <[email protected]>
wrote:

> On 11/20/2014 10:18 AM, Óscar Fuentes wrote:
> > Wayne Stambaugh <[email protected]>
> > writes:
> >
> >> I have the same issue building KiCad.  CMake does not appear to know how
> >> to properly define the default search path for MinGW.  It probably sees
> >> MSYS defined and sets the default search path to /usr which is not what
> >> you want unless you are actually building an msys application.  You can
> >> find out what this path actually is by printing the CMAKE_PREFIX_PATH
> >> variable.  You can override this by calling cmake with
> >> -DCMAKE_PREFIX_PATH=/mingw64.  You shouldn't have to rename
> >> /usr/bin/pkg-config.exe.
> >
> >   CMAKE_PREFIX_PATH
> >        Path used for searching by FIND_XXX(), with appropriate suffixes
> >        added.
> >
> >        [...] By default it is empty, it is intended
> >        to be set by the project.  See also CMAKE_SYSTEM_PREFIX_PATH,
> >        CMAKE_INCLUDE_PATH, CMAKE_LIBRARY_PATH, CMAKE_PROGRAM_PATH.
> >
> >
> > Are you saying that CMAKE_PREFIX_PATH is not empty by default on your
> > CMake scripts?
>
> I just checked my cmake configuration and here are the values of
> CMAKE_SYSTEM_PREFIX_PATH and CMAKE_PREFIX_PATH when CMAKE_PREFIX_PATH is
> not defined:
>
> -- CMAKE_SYSTEM_PREFIX_PATH="C:\Program Files;C:\Program
> Files;C:/msys64/mingw64;C:/msys64/mingw64" ; CMAKE_PREFIX_PATH=""
>
> You are correct, CMAKE_PREFIX_PATH is empty.  I've working been under
> the assumption that the search paths were not correct because I always
> had to define both CMAKE_PREFIX_PATH=/mingw64 and
> OPENSSL_ROOT_DIR=/mingw64 to get FindOpenSSL to work properly.  It looks
> like FindOpenSSL is the problem.  I'm not sure having "C:\Program Files"
> is in the system search path for MinGW is a good idea.  At very least I
> would think that "c:/msys64/mingw64" would be first in the search list.
>  It also appears the cmake is appending the system paths twice somewhere
> during the configuration.
>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> > with Interactivity, Sharing, Native Excel Exports, App Integration & more
> > Get technology previously reserved for billion-dollar corporations, FREE
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> > _______________________________________________
> > Msys2-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/msys2-users
> >
>
>
>
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
>
> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
> _______________________________________________
> Msys2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/msys2-users
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Msys2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msys2-users

Reply via email to