On 21. Jan, 2010, at 16:57 , Jed Brown wrote:

> On Thu, 21 Jan 2010 15:44:43 +0000, Mateusz Loskot <mate...@loskot.net> wrote:
>> Why it can not work, actually?
> 
> C++ does name mangling so it's difficult to determine what the symbol
> actually is (you have to know about various classes and templates that
> may be in scope), therefore the interface would look a bit different.
> In particular, it would require locating and including headers because
> "private" details of a template library can change how the symbol is
> mangled.
> 
> It's almost certainly the case that it works for C because it's easy to
> make work for C, and not for C++ because that would be hard, and you
> probably need to use check_cxx_source_compiles/check_cxx_source_runs in
> order to find a C++ symbol anyway.
> 
> Jed

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.


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