On Thu, 21 Jan 2010 17:03:27 +0100, Michael Wild <[email protected]> wrote:
> But both of them just do a try_compile. I don't see where the
> name-mangling comes in there... If the user wants to check for a
> template, he has to instantiate the template,
> e.g. check_cxx_function_exists("std::copy<std::string::const_iterator,
> std::string::iterator>" "algorithm;string" HAVE_STD_COPY). Tedious,
> but should work. To check for classes, you'd need a different macro,
> however.

You're kidding, right?  Have you looked at CheckFunctionExists.c?  It
declares the symbol as

  char SYMBOL_NAME();

and then tries to link a program that calls this function.  No headers
are included, so there is no way for this symbol to match the mangled
symbol in the library.

Of course, you could write a completely different thing with an
interface more like check_cxx_source_compiles, and call this new thing
check_cxx_function_exists, but that would be terribly inconsistent so I
hope you don't.

Jed
_______________________________________________
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

Reply via email to