Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-10-04 Thread Brad King
On 10/04/2013 05:46 AM, Daniele E. Domenichelli wrote: This is the test that is failing, according to my knowledge of C it should build, even with very old compilers... The problem is the empty struct: struct struct_with_non_existent_members { }; Some C compilers reject that. You'll have

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-10-02 Thread Brad King
On 10/02/2013 07:14 AM, Daniele E. Domenichelli wrote: On 25/09/13 18:49, Brad King wrote: On 09/25/2013 12:16 PM, Daniele E. Domenichelli wrote: I updated the CheckStructHasMember_CXX topic. That looks good, though I haven't tested it by hand myself. While at this, please look at adding

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-10-02 Thread Daniele E. Domenichelli
On 02/10/13 16:23, Brad King wrote: You could also add a RunCMake/CheckModules case to check the error conditions (bad args and bad language). Done! Cheers, Daniele -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-24 Thread Daniele E. Domenichelli
On 23/09/13 17:50, Brad King wrote: One could add an optional extra parameter to specify the language to be used for the check (C or CXX). However, we should do something that could be re-used in the similar modules too. Would you mind surveying all the check signatures we currently have and

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-24 Thread Brad King
On 09/24/2013 03:50 AM, Daniele E. Domenichelli wrote: It looks like that the signatures are not very consistent... Yes, but they all have room for optional keyword-based arguments following the main arguments. How about CHECK_STRUCT_HAS_MEMBER (struct member header variable

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-24 Thread Daniele E. Domenichelli
On 24/09/13 14:18, Brad King wrote: On 09/24/2013 03:50 AM, Daniele E. Domenichelli wrote: It looks like that the signatures are not very consistent... Yes, but they all have room for optional keyword-based arguments following the main arguments. How about CHECK_STRUCT_HAS_MEMBER

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-24 Thread Brad King
On 09/24/2013 09:46 AM, Daniele E. Domenichelli wrote: Any convention works for me... Perhaps also the other Check module should follow the same convention, though. If anyone wants to take this action then go for it. I wouldn't consider it a high priority though. I pushed a commit to the

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-24 Thread Daniele E. Domenichelli
On 24/09/13 16:44, Brad King wrote: On 09/24/2013 09:46 AM, Daniele E. Domenichelli wrote: I pushed a commit to the CheckStructHasMember_CXX topic, can you review it? You can simplify the implementation using ${ARGN} to get the arguments beyond those explicitly named in the signature. You

[cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-23 Thread Daniele E. Domenichelli
Hello, CheckStructHasMember does not support C++ only structs. If headers required to check if a struct has a member can be compiled with C++ compiler only, the check will fail, because the C compiler will fail. As a consequence, the result variable is set to false, even if the struct has that

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-23 Thread Daniele E. Domenichelli
Sorry disregard my previous mail... My problem was actually different and the attached patch didn't work... Regards, Daniele On 23/09/13 10:27, Daniele E. Domenichelli wrote: Hello, CheckStructHasMember does not support C++ only structs. If headers required to check if a struct has a

Re: [cmake-developers] CheckStructHasMember does not support C++ only structs

2013-09-23 Thread Brad King
On 09/23/2013 04:27 AM, Daniele E. Domenichelli wrote: The attached patch adds 2 new macros: - CHECK_CXX_STRUCT_HAS_MEMBER (similar to CHECK_STRUCT_HAS_MEMBER but uses the C++ compiler) - CHECK_C_STRUCT_HAS_MEMBER (identical to CHECK_STRUCT_HAS_MEMBER, added for symmetry) that can be used