Re: [CMake] check function signature

2012-09-25 Thread Bogdan Cristea
On Tuesday 25 September 2012 09:18:38 Leif Walsh wrote:
 I use check_function_exists() to do some platform checking.  On Linux,
 pthread_yield() returns int, and on FreeBSD, it returns void.  Is there a
 cmake way to distinguish between the two?  check_function_exists seems to
 not use strict enough warnings to make sure the symbol has the right
 signature at link time.

The simplest way would be to write your own check_function_exists macro in 
order to check for the specific function declaration.

regards
-- 
Bogdan
--

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


Re: [CMake] check function signature

2012-09-25 Thread Nils Gladitz

Maybe you want check_prototype_definition?

Nils

On 09/25/2012 03:18 PM, Leif Walsh wrote:

I use check_function_exists() to do some platform checking.  On Linux, 
pthread_yield() returns int, and on FreeBSD, it returns void.  Is there a cmake 
way to distinguish between the two?  check_function_exists seems to not use 
strict enough warnings to make sure the symbol has the right signature at link 
time.



--
Nils Gladitz, B.Sc.
DICOM, Konnektivität und Entwicklung

Scivis wissenschaftliche Bildverarbeitung GmbH
Bertha-von-Suttner-Str. 5
D-37085 Göttingen
GERMANY
Handelsregister Nr. / Trade Register No. B3100 Göttingen
Geschäftsführer / Managing Directors Dr. Gernot Ebel, Dr. Uwe Engeland

Tel: 0049 (0)551 634181-28
E-Mail: glad...@scivis.de
Web: www.scivis.de

--

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


Re: [CMake] check function signature

2012-09-25 Thread Leif Walsh
this works perfectly, thanks

On 25 Sep, 2012, at 9:45 AM, Nils Gladitz glad...@sci-vis.de wrote:

 Maybe you want check_prototype_definition?
 
 Nils
 
 On 09/25/2012 03:18 PM, Leif Walsh wrote:
 I use check_function_exists() to do some platform checking.  On Linux, 
 pthread_yield() returns int, and on FreeBSD, it returns void.  Is there a 
 cmake way to distinguish between the two?  check_function_exists seems to 
 not use strict enough warnings to make sure the symbol has the right 
 signature at link time.
 
 
 -- 
 Nils Gladitz, B.Sc.
 DICOM, Konnektivität und Entwicklung
 
 Scivis wissenschaftliche Bildverarbeitung GmbH
 Bertha-von-Suttner-Str. 5
 D-37085 Göttingen
 GERMANY
 Handelsregister Nr. / Trade Register No. B3100 Göttingen
 Geschäftsführer / Managing Directors Dr. Gernot Ebel, Dr. Uwe Engeland
 
 Tel: 0049 (0)551 634181-28
 E-Mail: glad...@scivis.de
 Web: www.scivis.de
 

-- 
Cheers,
Leif

--

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