Re: [CMake] Getting the compiler version?

2009-04-15 Thread Brad King

Philip Lowman wrote:
On Tue, Apr 14, 2009 at 11:17 AM, Bartlett, Roscoe A raba...@sandia.gov 
mailto:raba...@sandia.gov wrote:


Thanks for the pointer.  We will look into this and try to create a
module that other people could use also.  However, it would be good
if we could get this added as an official CMake module that can be
supported by a broader community.

You might be able to get a lot of what you're looking for from 
preprocessor definitions.  These could be wrapped into a CMake function 
that calls try_run()


http://predef.sf.net


Currently the CMAKE_LANG_COMPILER_ID variables are computed using the
preprocessor.  Basically we compile a source file with default flags and
then read the strings directly out of the resulting binaries (which works
for cross-compiling too).  I want to extend this to get the compiler
version and perhaps some other information in one step, but I've not had
time to do it yet.

-Brad

___
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] Getting the compiler version?

2009-04-14 Thread Mike Jackson
Not really a portable way but there are usually compiler specific
ways which then get wrapped in lots of if() commands based on what
is being used.

If you look through the FindBoost.cmake file that comes with CMake
around line 535 you may be able to pull out that code which does a
pretty decent job of determining compiler versions.

Mike Jackson

On Tue, Apr 14, 2009 at 10:04 AM, Bartlett, Roscoe A raba...@sandia.gov wrote:
 Hello,

 Is there some way portable to get the compiler version in CMake so that I
 can print it out in the configure output?  This is important for our
 portability testing system based on Cmake/Ctest/Cdash.

 Thanks,

 - Ross

___
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] Getting the compiler version?

2009-04-14 Thread Bartlett, Roscoe A
Mike,

Thanks for the pointer.  We will look into this and try to create a module that 
other people could use also.  However, it would be good if we could get this 
added as an official CMake module that can be supported by a broader community.

Thanks,

- Ross
 

 -Original Message-
 From: Mike Jackson [mailto:mike.jack...@bluequartz.net] 
 Sent: Tuesday, April 14, 2009 8:28 AM
 To: Bartlett, Roscoe A
 Cc: cmake@cmake.org; Perschbacher, Brent M
 Subject: Re: [CMake] Getting the compiler version?
 
 Not really a portable way but there are usually compiler 
 specific ways which then get wrapped in lots of if() 
 commands based on what is being used.
 
 If you look through the FindBoost.cmake file that comes with 
 CMake around line 535 you may be able to pull out that code 
 which does a pretty decent job of determining compiler versions.
 
 Mike Jackson
 
 On Tue, Apr 14, 2009 at 10:04 AM, Bartlett, Roscoe A 
 raba...@sandia.gov wrote:
  Hello,
 
  Is there some way portable to get the compiler version in CMake so 
  that I can print it out in the configure output?  This is important 
  for our portability testing system based on Cmake/Ctest/Cdash.
 
  Thanks,
 
  - Ross
 
 
 
___
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] Getting the compiler version?

2009-04-14 Thread Philip Lowman
On Tue, Apr 14, 2009 at 11:17 AM, Bartlett, Roscoe A raba...@sandia.govwrote:

 Thanks for the pointer.  We will look into this and try to create a module
 that other people could use also.  However, it would be good if we could get
 this added as an official CMake module that can be supported by a broader
 community.


You might be able to get a lot of what you're looking for from preprocessor
definitions.  These could be wrapped into a CMake function that calls
try_run()

http://predef.sf.net

-- 
Philip Lowman
___
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