[cmake-developers] find_program() not using PATH on Windows?

Robert Dailey rcdailey.lists at gmail.com
Mon Mar 20 10:17:26 EDT 2017


On Mon, Mar 20, 2017 at 8:40 AM, Brad King <brad.king at kitware.com> wrote:
> On 03/17/2017 05:38 PM, Robert Dailey wrote:
>> find_program(GIT_EXECUTABLE git)
>
> The steps it follows are documented here:
>
>   https://cmake.org/cmake/help/v3.8/command/find_program.html
>
> It does include PATH, so it is strange that it is not working.
> Just to be sure the environment is as expected, add
>
>   message(STATUS "PATH=$ENV{PATH}")
>
> just before the find_program call.

Here is the result:

PATH=C:\ProgramData\Oracle\Java\javapath;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program
Files\Beyond Compare
4;E:\ant\bin;E:\android\sdk\tools;E:\android\sdk\platform-tools;E:\code\ziosk-scripts\device-scripts;E:\tools\ninja;E:\Ruby22\bin;E:\Python35;E:\Python35\Scripts;E:\Program
Files\CMake\bin;E:\Program Files\CMake\bin;C:\Program Files
(x86)\Notepad++;E:\Git\cmd;C:\Program Files (x86)\Windows
Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft
Emulator Manager\1.0\;C:\Program
Files\TortoiseSVN\bin;C:\Users\robert\AppData\Local\Microsoft\WindowsApps;

Notice that "E:\Git\cmd" is in the list. Trust me I've beat the hell
out of this one, I can't figure out what's going on. I even enabled
trace logs but it didn't help much.

What can I do to help you guys diagnose this problem? I could try
getting a reproducible script for you, but this is so dependent on
environment I'm not sure if it will serve as a good test case.

let me know.


More information about the cmake-developers mailing list