Hi all,

With respect to my previous post.
Is it possible to somehow reset the result variable from
CheckCSourceCompiles(SOURCE VAR)?

I wanted to run a number of tests in a foreach loop, using the same
C-code snippet, but with one CMake variable being substituted, but I
noticed that the test is run only once. Is there a way to reuse/reset
the cache variable "result", or should I make the result variable
unique, e.g. HAVE_${func_name}?

foreach(func_name __PRETTY_FUNCTION__ __FUNCTION__)
  check_c_source_compiles("
    #include <stdio.h>
    int main() { puts(${func_name}); }
    " result)
# if(result)
#   break()
# endif(result)
endforeach(func_name __PRETTY_FUNCTION__ __FUNCTION__)


_______________________________________________
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