Re: [cmake-developers] Git for windows patch

2016-01-15 Thread Brad King
On 01/14/2016 06:48 PM, Shawn Waldon wrote:
> patch that tells CMake to look in the default install location for
> Git for Windows [2] when asked for git.

This is expected to work already as follows.  This code:

 
https://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/Platform/WindowsPaths.cmake;hb=v3.4.1#l25

adds the program files directories to CMAKE_SYSTEM_PREFIX_PATH. Then
the find_program call in FindGit:

 
https://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindGit.cmake;hb=v3.4.1#l54

uses the PATH_SUFFIXES options "Git/cmd" and "Git/bin" to look in
the relevant install directories.

You'll have to investigate locally to determine why this method is
not working.

-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Git for windows patch

2016-01-15 Thread Shawn Waldon
Hi Kanstantin,

Thanks for the feedback.  The location of git that I have always used is
"C:\Program Files [(x86)]\bin\git.exe".  Looking at the git installation,
there is another executable "C:\Program Files (x86)\Git\cmd\git.exe", but I
have never pointed CMake at that one.  What is the difference between the
two?  I can change the patch to use the other one, but I'd like to
understand why it is necessary.

Thanks,
Shawn

On Thu, Jan 14, 2016 at 10:42 PM, Konstantin Podsvirov <
konstan...@podsvirov.pro> wrote:

> Hi, Shawn!
>
> I am using CMake and Git on the Windows. As an IDE I use Qt Creator.
>
> My experience is that on Windows you need to use:
>
> "C:\Program Files [(x86)]\Git\cmd\git.exe"
>
> If you use your proposed way, I'm having problems
> work with Git in my project.
>
> It seems to me that this decision is necessary to discuss here.
>
> Dear list, does anyone have experience and recommendations?
>
> 15.01.2016, 02:49, "Shawn Waldon" :
> > Hi,
> >
> > Recently I had to build a project on windows whose required build git.
> And even though I had installed git from here [1] in the default location,
> I had to tell CMake where to find it every time I did a build in a clean
> build tree. So here is a patch that tells CMake to look in the default
> install location for Git for Windows [2] when asked for git. I have tested
> it on my windows machine and it works there.
> >
> > Shawn
> >
> > [1]: https://git-for-windows.github.io/
> > [2]: C:\Program Files\Git\bin\git.exe ('Program Files (x86)' for older
> versions or 32 bit systems)
> > ,--
> >
> > Powered by www.kitware.com
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
> >
> > CMake Support: http://cmake.org/cmake/help/support.html
> > CMake Consulting: http://cmake.org/cmake/help/consulting.html
> > CMake Training Courses: http://cmake.org/cmake/help/training.html
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Follow this link to subscribe/unsubscribe:
> > http://public.kitware.com/mailman/listinfo/cmake-developers
>
>
> Regards,
> Konstantin Podsvirov
>
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] Git for windows patch

2016-01-15 Thread Paul Smith
On Fri, 2016-01-15 at 11:37 -0500, Jean-Christophe Fillion-Robin wrote:
> > The existence of \bin is there only for backward
> -compatibility
> 
> I guess we could also add "Git/usr/bin" to the suffixes so that it
> prefer newer version first ?
> 
> PATH_SUFFIXES Git/usr/bin Git/cmd Git/bin 

I'm not sure which command you're looking for?

git.exe exists only in Git/bin (old-style) and Git/cmd.  Where both
exist they'll have exactly the same version of git.exe in them.

I think using Git/cmd only to find git.exe is fine; I'm pretty sure
it's always existed there even in older releases of Git for Windows, an
d will continue to do so going forward.

You definitely don't need Git/usr/bin unless you want to find all the
UNIX tools.  Git.exe is not there.
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Git for windows patch

2016-01-15 Thread Paul Smith
On Fri, 2016-01-15 at 10:05 -0500, Shawn Waldon wrote:
> Looking at the git installation, there is another executable
> "C:\Program Files (x86)\Git\cmd\git.exe", but I have never pointed
> CMake at that one.  What is the difference between the two?  I can
> change the patch to use the other one, but I'd like to understand why
> it is necessary.

There is no difference between them.  When you install Git for Windows
the installer gives a choice of three different ways to set up %PATH%.

One way is to not add anything to %PATH%: then git is only available
from within the Git bash shell not from within command.com shell.

The second way is to make git, only (plus a few helpers like gitk,
start-ssh-agent, etc.) available on %PATH%: then git is available from
command.com but none of the other UNIX tools like find, diff, etc. are
available from command.com (only from Git shell).  In this install
method the \cmd directory is added to %PATH%.

The last way is to allow git plus all the ming32 versions of UNIX tools
that come with Git to be available to command.com.  In this install
method both \cmd AND \usr\bin are added to %PATH%.

The existence of \bin is there only for backward
-compatibility, because some people coming from older versions of Git
for Windows might be referencing it.  It shouldn't be used anymore by
modern installs (it contains bash.exe and sh.exe both of which are in
\usr\bin, and git.exe which is in \cmd).
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Git for windows patch

2016-01-15 Thread Jean-Christophe Fillion-Robin
Hi,

> The existence of \bin is there only for backward
-compatibility

I guess we could also add "Git/usr/bin" to the suffixes so that it prefer
newer version first ?

PATH_SUFFIXES Git/usr/bin Git/cmd Git/bin

Hth
Jc

On Fri, Jan 15, 2016 at 11:24 AM, Paul Smith  wrote:

> On Fri, 2016-01-15 at 10:05 -0500, Shawn Waldon wrote:
> > Looking at the git installation, there is another executable
> > "C:\Program Files (x86)\Git\cmd\git.exe", but I have never pointed
> > CMake at that one.  What is the difference between the two?  I can
> > change the patch to use the other one, but I'd like to understand why
> > it is necessary.
>
> There is no difference between them.  When you install Git for Windows
> the installer gives a choice of three different ways to set up %PATH%.
>
> One way is to not add anything to %PATH%: then git is only available
> from within the Git bash shell not from within command.com shell.
>
> The second way is to make git, only (plus a few helpers like gitk,
> start-ssh-agent, etc.) available on %PATH%: then git is available from
> command.com but none of the other UNIX tools like find, diff, etc. are
> available from command.com (only from Git shell).  In this install
> method the \cmd directory is added to %PATH%.
>
> The last way is to allow git plus all the ming32 versions of UNIX tools
> that come with Git to be available to command.com.  In this install
> method both \cmd AND \usr\bin are added to %PATH%.
>
> The existence of \bin is there only for backward
> -compatibility, because some people coming from older versions of Git
> for Windows might be referencing it.  It shouldn't be used anymore by
> modern installs (it contains bash.exe and sh.exe both of which are in
> \usr\bin, and git.exe which is in \cmd).
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers
>



-- 
+1 919 869 8849
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Re: [cmake-developers] Git for windows patch

2016-01-15 Thread Brad King
On 01/15/2016 10:25 AM, Brad King wrote:
> You'll have to investigate locally to determine why this method is
> not working.

It looks like a 64-bit CMake binary would not properly include
the "Program Files (x86)" directory as a search location due to
outdated assumptions.  Please try this fix:

 Windows: Find Program Files directories more robustly from environment
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=09b2f1c3

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


Re: [cmake-developers] Git for windows patch

2016-01-14 Thread Konstantin Podsvirov
Hi, Shawn!

I am using CMake and Git on the Windows. As an IDE I use Qt Creator.

My experience is that on Windows you need to use:

"C:\Program Files [(x86)]\Git\cmd\git.exe"

If you use your proposed way, I'm having problems
work with Git in my project.

It seems to me that this decision is necessary to discuss here.

Dear list, does anyone have experience and recommendations?

15.01.2016, 02:49, "Shawn Waldon" :
> Hi,
>
> Recently I had to build a project on windows whose required build git. And 
> even though I had installed git from here [1] in the default location, I had 
> to tell CMake where to find it every time I did a build in a clean build 
> tree. So here is a patch that tells CMake to look in the default install 
> location for Git for Windows [2] when asked for git. I have tested it on my 
> windows machine and it works there.
>
> Shawn
>
> [1]: https://git-for-windows.github.io/
> [2]: C:\Program Files\Git\bin\git.exe ('Program Files (x86)' for older 
> versions or 32 bit systems)
> ,--
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers


Regards,
Konstantin Podsvirov
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers


[cmake-developers] Git for windows patch

2016-01-14 Thread Shawn Waldon
Hi,

Recently I had to build a project on windows whose build required git.  And
even though I had installed git from here [1] in the default location, I
had to tell CMake where to find it every time I did a build in a clean
build tree.  So here is a patch that tells CMake to look in the default
install location for Git for Windows [2] when asked for git.  I have tested
it on my windows machine and it works there.

Shawn

[1]: https://git-for-windows.github.io/
[2]: C:\Program Files\Git\bin\git.exe ('Program Files (x86)' for older
versions or 32 bit systems)
From 9cb6cda92245779f9c3868d6bcc88edb4f02db6b Mon Sep 17 00:00:00 2001
From: Shawn Waldon 
Date: Thu, 14 Jan 2016 18:18:41 -0500
Subject: [PATCH] git: add search paths for default git for windows install

---
 Modules/FindGit.cmake | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Modules/FindGit.cmake b/Modules/FindGit.cmake
index 2c3e5fd..6f6e41e 100644
--- a/Modules/FindGit.cmake
+++ b/Modules/FindGit.cmake
@@ -50,12 +50,14 @@ if(WIN32)
 file(GLOB github_path "${github_path}")
 # SourceTree search path for Windows
 set(_git_sourcetree_path "$ENV{LOCALAPPDATA}/Atlassian/SourceTree/git_local/bin")
+# Git for Windows (git-for-windows.github.io) paths
+set(_git_for_windows_paths "C:/Program Files/Git/bin;C:/Program Files (x86)/Git/bin")
   endif()
 endif()
 
 find_program(GIT_EXECUTABLE
   NAMES ${git_names}
-  PATHS ${github_path} ${_git_sourcetree_path}
+  PATHS ${github_path} ${_git_sourcetree_path} ${_git_for_windows_paths}
   PATH_SUFFIXES Git/cmd Git/bin
   DOC "git command line client"
   )
-- 
2.5.0

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers