Re: [CMake] Checking function or symbol in namespace

2010-01-23 Thread Michael Wild
On 23. Jan, 2010, at 16:42 , Mateusz Loskot wrote: > Jed Brown wrote: >> On Thu, 21 Jan 2010 15:44:43 +, Mateusz Loskot >> 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 cl

Re: [CMake] Checking function or symbol in namespace

2010-01-23 Thread Mateusz Loskot
Jed Brown wrote: > On Thu, 21 Jan 2010 15:44:43 +, Mateusz Loskot 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 inter

Re: [CMake] Checking function or symbol in namespace

2010-01-22 Thread Mateusz Loskot
Michael Wild wrote: > IMHO the documentation should be clarified... Just for records, there is bug report opened which is related to my question: http://public.kitware.com/Bug/view.php?id=8758 Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org

Re: [CMake] Checking function or symbol in namespace

2010-01-22 Thread Mateusz Loskot
Mateusz Loskot wrote: > I'm trying to perform the following checks: > > check_function_exists(std::pow HAVE_POW) > > or > > check_symbol_exists(std::pow cmath HAVE_POW) > > but it looks that both macros have troubles > with resolving std:: namespace. > > The documentation is not very clear abo

Re: [CMake] Checking function or symbol in namespace

2010-01-22 Thread Marcel Loose
On Fri, 2010-01-22 at 10:33 +0100, Jed Brown wrote: > On Fri, 22 Jan 2010 10:24:30 +0100, "Marcel Loose" wrote: > > Partly true. > > If the preprocessor symbol provides a generic name for a function, which > > may have different names on different platforms, it will still work. > > > > For exampl

Re: [CMake] Checking function or symbol in namespace

2010-01-22 Thread Jed Brown
On Fri, 22 Jan 2010 10:24:30 +0100, "Marcel Loose" wrote: > Partly true. > If the preprocessor symbol provides a generic name for a function, which > may have different names on different platforms, it will still work. > > For example. > > # define basename __xdg_basename No. It will *not* wo

Re: [CMake] Checking function or symbol in namespace

2010-01-22 Thread Marcel Loose
On Thu, 2010-01-21 at 13:47 +0100, Michael Wild wrote: > On 21. Jan, 2010, at 12:07 , Marcel Loose wrote: > > > On Thu, 2010-01-21 at 10:14 +0100, Michael Wild wrote: > >> On 21. Jan, 2010, at 9:56 , Marcel Loose wrote: > >> > >>> On Thu, 2010-01-21 at 06:52 +0100, Michael Wild wrote: > On 2

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Jed Brown
On Thu, 21 Jan 2010 16:55:20 +, Mateusz Loskot wrote: > Yes, though I'd annoyingly keep my side that CXX variants of the macros > would be useful and make C vs C++ separation more clear to user. The problem is that the interface for the C++ variant *cannot* look like check_function_exists, be

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Mateusz Loskot
Michael Wild wrote: On 21. Jan, 2010, at 17:17 , Jed Brown wrote: On Thu, 21 Jan 2010 17:03:27 +0100, Michael Wild 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 templat

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Mateusz Loskot
Eric Noulard wrote: 2010/1/21 Mateusz Loskot : The fact check_function_exists checks C function but not C++ free function is a bit confusing. That's true. AFAIU, CMake is dedicated to build C++ source code, However that's look false to me :-( Perhaps I should be more precise, I meant CM

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Michael Wild
On 21. Jan, 2010, at 17:17 , Jed Brown wrote: > On Thu, 21 Jan 2010 17:03:27 +0100, Michael Wild 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. ch

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Jed Brown
On Thu, 21 Jan 2010 17:03:27 +0100, Michael Wild 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::iterat

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Michael Wild
On 21. Jan, 2010, at 16:57 , Jed Brown wrote: > On Thu, 21 Jan 2010 15:44:43 +, Mateusz Loskot 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

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Jed Brown
On Thu, 21 Jan 2010 15:44:43 +, Mateusz Loskot 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 differ

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Mateusz Loskot
Michael Wild wrote: On 21. Jan, 2010, at 16:44 , Mateusz Loskot wrote: Michael Wild wrote: On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: Hi, I'm trying to perform the following checks: check_function_exists(std::pow HAVE_POW) or check_symbol_exists(std::pow cmath HAVE_POW) but it looks

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Eric Noulard
2010/1/21 Mateusz Loskot : > The fact check_function_exists checks C function but not C++ free > function is a bit confusing. That's true. > AFAIU, CMake is dedicated to build C++ source code, However that's look false to me :-( > so I suppose many users may expect it works > well for both C a

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Michael Wild
On 21. Jan, 2010, at 16:44 , Mateusz Loskot wrote: > Michael Wild wrote: >> On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: >>> Hi, >>> I'm trying to perform the following checks: >>> check_function_exists(std::pow HAVE_POW) >>> or >>> check_symbol_exists(std::pow cmath HAVE_POW) >>> but it lo

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Mateusz Loskot
Michael Wild wrote: On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: Hi, I'm trying to perform the following checks: check_function_exists(std::pow HAVE_POW) or check_symbol_exists(std::pow cmath HAVE_POW) but it looks that both macros have troubles with resolving std:: namespace. The

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Michael Wild
On 21. Jan, 2010, at 12:07 , Marcel Loose wrote: > On Thu, 2010-01-21 at 10:14 +0100, Michael Wild wrote: >> On 21. Jan, 2010, at 9:56 , Marcel Loose wrote: >> >>> On Thu, 2010-01-21 at 06:52 +0100, Michael Wild wrote: On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: > Hi, >

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Marcel Loose
On Thu, 2010-01-21 at 10:14 +0100, Michael Wild wrote: > On 21. Jan, 2010, at 9:56 , Marcel Loose wrote: > > > On Thu, 2010-01-21 at 06:52 +0100, Michael Wild wrote: > >> On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: > >> > >>> Hi, > >>> > >>> I'm trying to perform the following checks: > >

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Michael Wild
On 21. Jan, 2010, at 9:56 , Marcel Loose wrote: > On Thu, 2010-01-21 at 06:52 +0100, Michael Wild wrote: >> On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: >> >>> Hi, >>> >>> I'm trying to perform the following checks: >>> >>> check_function_exists(std::pow HAVE_POW) >>> >>> or >>> >>> ch

Re: [CMake] Checking function or symbol in namespace

2010-01-21 Thread Marcel Loose
On Thu, 2010-01-21 at 06:52 +0100, Michael Wild wrote: > On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: > > > Hi, > > > > I'm trying to perform the following checks: > > > > check_function_exists(std::pow HAVE_POW) > > > > or > > > > check_symbol_exists(std::pow cmath HAVE_POW) > > > > bu

Re: [CMake] Checking function or symbol in namespace

2010-01-20 Thread Michael Wild
On 21. Jan, 2010, at 24:55 , Mateusz Loskot wrote: > Hi, > > I'm trying to perform the following checks: > > check_function_exists(std::pow HAVE_POW) > > or > > check_symbol_exists(std::pow cmath HAVE_POW) > > but it looks that both macros have troubles > with resolving std:: namespace. > >

[CMake] Checking function or symbol in namespace

2010-01-20 Thread Mateusz Loskot
Hi, I'm trying to perform the following checks: check_function_exists(std::pow HAVE_POW) or check_symbol_exists(std::pow cmath HAVE_POW) but it looks that both macros have troubles with resolving std:: namespace. The documentation is not very clear about that. Or I should stick to try_compil