On 4 January 2013 14:46, Bill Hoffman <bill.hoff...@kitware.com> wrote:
> On 1/4/2013 9:24 AM, Mateusz Loskot wrote:
>>
>> It tests if C compiler supports C99 restrict keyword,
>> perhaps also implementation-specific form, e.g. __restrict, etc.
>>
>> [1]http://en.wikipedia.org/wiki/Restrict
>
> Should be able to do it with a CheckCSourceCompiles:
>
>
> http://www.cmake.org/cmake/help/v2.8.10/cmake.html#module:CheckCSourceCompiles

Yup:

CHECK_C_SOURCE_COMPILES (
  "int test (void *restrict x); int main (void) {return 0;}"
  HAVE_RESTRICT)

Lots of examples available:
https://github.com/pjanouch/aapng/blob/master/CMakeLists.txt
https://bitbucket.org/poulson/clique/src/ca43759adbe4/external/elemental/CMakeLists.txt

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

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