Detecting Solaris & its STL variations

Adriaan de Groot <[email protected]>
Newsgroups gmane.comp.kde.solaris
Message-ID <[email protected]>
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

___________________________________________________
This message is from the kde-solaris mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde-solaris.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.
signature.asc (application/pgp-signature, 187 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQBGyrg4dqzuAf6io/4RAjpJAJ9IzLgWMMQ22XDfAawOXvgJADkfWgCdEemi
2bI6oM6/+Wxkl0QDE5blfYI=
=mMOL
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.