Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-17 Thread Bill Hoffman

On 7/17/2012 2:41 PM, Sean McBride wrote:

On Tue, 17 Jul 2012 14:22:20 -0400, Bill Hoffman said:


Not that I know of.  That would be analogous to...?  What would it do?


In VS it setups the environment to run CC from the command line.



For now, I've created this bug:

CMake should support default installation of Xcode.app only, without

'command line tools' extras




I am not sure I agree with the statement.  CMake has always required
that the command line tools that it uses be in the environment.  I
really don't see how CMake could technically use xcrun to configure an
environment correctly so that things would work.  On all platforms CMake
requires the environment to work from the command line.


Well, I don't know enough about how cmake works internally, but I was under the 
impression that it looks for things in certain well-known places in hopes of 
finding them.  I just greped the code for 'usr/local/bin' and here's an example 
of what I mean:

   set(gp_cmd_paths ${gp_cmd_paths}
 "C:/Program Files/Microsoft Visual Studio 9.0/VC/bin"
 "C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin"
 "C:/Program Files/Microsoft Visual Studio 8/VC/BIN"
 "C:/Program Files (x86)/Microsoft Visual Studio 8/VC/BIN"
 "C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/BIN"
 "C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/BIN"
 "/usr/local/bin"
 "/usr/bin"
 )


That is to find ONE executable, devenv.  We do that to find Xcode. 
However, to find an entire tool chain for a compiler is a whole 
different story.




Is this not a trial-and-error way of finding which folder holds the
sought item?  Wouldn't it be a matter of extending this facility?
(Not that I'm saying it would be trivial to do so...)

Perhaps these tests should only be run conditional on the presence
of

PackageMaker instead of allowed to fail hard?



This we might be able to fix.


Cool.  Shall I create a bug for that?


Sure.

-Bill
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-17 Thread Sean McBride
On Tue, 17 Jul 2012 14:22:20 -0400, Bill Hoffman said:

>> Not that I know of.  That would be analogous to...?  What would it do?
>
>In VS it setups the environment to run CC from the command line.
>
>>
>> For now, I've created this bug:
>>
>> CMake should support default installation of Xcode.app only, without
>'command line tools' extras
>> 
>>
>I am not sure I agree with the statement.  CMake has always required 
>that the command line tools that it uses be in the environment.  I 
>really don't see how CMake could technically use xcrun to configure an 
>environment correctly so that things would work.  On all platforms CMake 
>requires the environment to work from the command line.

Well, I don't know enough about how cmake works internally, but I was under the 
impression that it looks for things in certain well-known places in hopes of 
finding them.  I just greped the code for 'usr/local/bin' and here's an example 
of what I mean:

  set(gp_cmd_paths ${gp_cmd_paths}
"C:/Program Files/Microsoft Visual Studio 9.0/VC/bin"
"C:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin"
"C:/Program Files/Microsoft Visual Studio 8/VC/BIN"
"C:/Program Files (x86)/Microsoft Visual Studio 8/VC/BIN"
"C:/Program Files/Microsoft Visual Studio .NET 2003/VC7/BIN"
"C:/Program Files (x86)/Microsoft Visual Studio .NET 2003/VC7/BIN"
"/usr/local/bin"
"/usr/bin"
)

Is this not a trial-and-error way of finding which folder holds the sought 
item?  Wouldn't it be a matter of extending this facility?  (Not that I'm 
saying it would be trivial to do so...)

>> Perhaps these tests should only be run conditional on the presence
>> of
>PackageMaker instead of allowed to fail hard?
>>
>This we might be able to fix.

Cool.  Shall I create a bug for that?

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-17 Thread Bill Hoffman

On 7/17/2012 1:38 PM, Sean McBride wrote:

On Fri, 13 Jul 2012 11:03:02 -0400, Bill Hoffman said:


I am guessing some of the tools will not run without proper environments
set.  So, running the command line compilers will not work by doing lots
of calls to xcrun -find  Think, ld, ar, gcc, g++, cfront, and all
the other stuff you need to run a compiler and cmake on the mac.   I
think we will have to take the stance that we do on windows, you have to
run cmake from a shell that is setup to run the compiler.


Perhaps, I'm not enough of a shell nor cmake expert to say...


Is there an xcvars?


Not that I know of.  That would be analogous to...?  What would it do?


In VS it setups the environment to run CC from the command line.



For now, I've created this bug:

CMake should support default installation of Xcode.app only, without 'command 
line tools' extras


I am not sure I agree with the statement.  CMake has always required 
that the command line tools that it uses be in the environment.  I 
really don't see how CMake could technically use xcrun to configure an 
environment correctly so that things would work.  On all platforms CMake 
requires the environment to work from the command line.



Relatedly, on my new-from-the-store Mac Mini, I'm getting two test failures:


both because the tests can't find PackageMaker. Indeed, PackageMaker

is no longer part of the default Xcode.app, nor is it installed as part
of the 'command line tools' but rather part of the separate 'auxiliary
tools' (there are about 7 stupid installers for all these separate
things now).


Perhaps these tests should only be run conditional on the presence
of

PackageMaker instead of allowed to fail hard?




This we might be able to fix.

-Bill
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-17 Thread Sean McBride
On Fri, 13 Jul 2012 11:03:02 -0400, Bill Hoffman said:

>I am guessing some of the tools will not run without proper environments 
>set.  So, running the command line compilers will not work by doing lots 
>of calls to xcrun -find  Think, ld, ar, gcc, g++, cfront, and all 
>the other stuff you need to run a compiler and cmake on the mac.   I 
>think we will have to take the stance that we do on windows, you have to 
>run cmake from a shell that is setup to run the compiler.

Perhaps, I'm not enough of a shell nor cmake expert to say...

>Is there an xcvars?

Not that I know of.  That would be analogous to...?  What would it do?  

For now, I've created this bug:

CMake should support default installation of Xcode.app only, without 'command 
line tools' extras


Relatedly, on my new-from-the-store Mac Mini, I'm getting two test failures:


both because the tests can't find PackageMaker.  Indeed, PackageMaker is no 
longer part of the default Xcode.app, nor is it installed as part of the 
'command line tools' but rather part of the separate 'auxiliary tools' (there 
are about 7 stupid installers for all these separate things now).

Perhaps these tests should only be run conditional on the presence of 
PackageMaker instead of allowed to fail hard?

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-13 Thread Bill Hoffman

On 7/13/2012 10:49 AM, Sean McBride wrote:

$ xcrun -find make
/Applications/Xcode.app/Contents/Developer/usr/bin/make


>Most of this is just a rant

Much of Apple's recent behaviour is very rant worthy, IMNSHO.
I am guessing some of the tools will not run without proper environments 
set.  So, running the command line compilers will not work by doing lots 
of calls to xcrun -find  Think, ld, ar, gcc, g++, cfront, and all 
the other stuff you need to run a compiler and cmake on the mac.   I 
think we will have to take the stance that we do on windows, you have to 
run cmake from a shell that is setup to run the compiler.   Is there an 
xcvars?


-Bill


--
Bill Hoffman
Kitware, Inc.
28 Corporate Drive
Clifton Park, NY 12065
bill.hoff...@kitware.com
http://www.kitware.com
518 881-4905 (Direct)
518 371-3971 x105
Fax (518) 371-4573


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-13 Thread Sean McBride
On Fri, 13 Jul 2012 10:18:38 -0400, Bill Hoffman said:

>> xcrun make --version
>
>That is so totally stupid
>
>What were they thinking at Apple...

I'm not privy to their thinking but... one advantage to this approach is the 
ability to have multiple versions of Xcode installed.  I have the current 4.3.3 
and the latest betas of 4.4 and 4.5.  I can invoke 'xcode-select -switch' to 
redirect 'xcrun' to any Xcode.app.  Then 'xcrun clang' will use the clang 
embedded in the chosen Xcode.app.  It's pretty useful really.

CMake wouldn't *need* to invoke 'xcrun make' to invoke make, though that's one 
way.  The other way is to ask xcrun to give you the path to make, ex:

$ xcrun -find make
/Applications/Xcode.app/Contents/Developer/usr/bin/make

>Most of this is just a rant

Much of Apple's recent behaviour is very rant worthy, IMNSHO.

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-13 Thread Bill Hoffman

On 7/12/2012 5:13 PM, David Cole wrote:

xcrun make --version


That is so totally stupid

What were they thinking at Apple...

Are you going to have to type "osrun ls" to get ls in the future?

Maybe it is more like MS VS studio now.  You have to run xcvars to be 
able to compile from the command line.  I am guessing autotools and 
other unix type build systems do not work with this either.


Most of this is just a rant, I suppose we will try to adapt.  However, I 
am not sure we can.  I think there will be other problems like not 
finding the compiler, and putting xcrun in front of every tool used is 
not going to work...



-Bill
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-12 Thread David Cole
On Thu, Jul 12, 2012 at 4:55 PM, Sean McBride wrote:

> Hi all,
>
> Nowadays, Xcode is distributed as a standalone .app instead of an
> installer that copies files all over the place.  As a consequence of this,
> nothing gets installed at /usr/bin/make, /usr/bin/cc, etc.
>
> Optionally, one can install a separate 'command line tools' package that
> places things at those venerable locations.  Without installing that, one
> can still find and use 'make' and other tools using 'xcrun' (see 'man
> xcrun').  ex:
>
> $ xcrun make --version
> GNU Make 3.81
>
> $ xcrun -find make
> /Applications/Xcode.app/Contents/Developer/usr/bin/make
>
> Without the 'command line tools' installed, CMake seems unable to get far:
>
> Error(s) when configuring the project
> CMake Error: CMake was unable to find a build program corresponding to
> "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to
> select a different build tool.
>
> It would be nice if CMake would invoke 'xcrun -find' to find the paths to
> the tools it needs.  Or can it already, and I'm missing something?
>
> Thanks,
>
> --
> 
> Sean McBride, B. Eng s...@rogue-research.com
> Rogue Researchwww.rogue-research.com
> Mac Software Developer  Montréal, Québec, Canada
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>


Good idea, but no, this is not implemented yet. We did not know about
"xcrun" yet. Thanks for the info.

For now, install the command line tools.

And, of course, patches are welcome. :-)
--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] Xcode without 'command line tools' & xcrun & CMake

2012-07-12 Thread Sean McBride
Hi all,

Nowadays, Xcode is distributed as a standalone .app instead of an installer 
that copies files all over the place.  As a consequence of this, nothing gets 
installed at /usr/bin/make, /usr/bin/cc, etc.

Optionally, one can install a separate 'command line tools' package that places 
things at those venerable locations.  Without installing that, one can still 
find and use 'make' and other tools using 'xcrun' (see 'man xcrun').  ex:

$ xcrun make --version
GNU Make 3.81

$ xcrun -find make
/Applications/Xcode.app/Contents/Developer/usr/bin/make

Without the 'command line tools' installed, CMake seems unable to get far:

Error(s) when configuring the project
CMake Error: CMake was unable to find a build program corresponding to "Unix 
Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a 
different build tool.

It would be nice if CMake would invoke 'xcrun -find' to find the paths to the 
tools it needs.  Or can it already, and I'm missing something?

Thanks,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada


--

Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake