[kde-solaris] Detecting Solaris & its STL variations

Adriaan de Groot groot at kde.org
Tue Aug 21 12:02:32 CEST 2007


It strikes me that it would be quite useful to have proper detection of 
Solaris, Sun Studio and the version of the STL it is using in CMake. It is 
something we need fairly high up in the software stack already -- in 
kdesupport, we need to link the C bindings to the right STL libraries 
explicitly, or the C apps using the bindings will be stuck with unresolved 
symbols.

How can we do this effectively? There seem to be _COMPILER_ variables defined 
when building regular KDE SVN modules, but it would be nice to have it always 
available -- it strikes me as a fairly generic issue on Solaris for any 
project using CMake.

Alex, where do you think that would fit? It would be something like this:

try_cxx_compile() # Does that even exist in stock cmake?
if(ok)
  set(CMAKE_OS_SOLARIS true)
endif(ok)

try_cxx_compile()
if(ok)
  set(CMAKE_COMPILER_SUNPRO true)
  try_cxx_compile()
  if(ok)
    set(CMAKE_STL_SUNCSTD true)
  else(ok)
    set(CMAKE_STL_SUNSTLPORT true)
  endif(ok)
endif(ok)



-- 
These are your friends - Adem
    GPG: FEA2 A3FE Adriaan de Groot
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-solaris/attachments/20070821/d1b0b82c/attachment.pgp 


More information about the kde-solaris mailing list