On 12/16/2010 01:07 PM, Campbell Barton wrote: > My question is why this is needed? > set(CFLAG_TEST "CFLAG_TEST") > CHECK_C_COMPILER_FLAG("${_FLAG}" CFLAG_TEST)
The CHECK_C_COMPILER_FLAG macro stores its result in the CMake cache so that it persists across multiple runs in the same build tree. Otherwise it will run the check every time which is far too expensive. Every call to this macro should have a unique name as the second argument to store the result persistently. > MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR) > IF("${VAR}" MATCHES "^${VAR}$") This is check is a hack for if(NOT DEFINED ${VAR}) from before the "DEFINED" test was supported by CMake's if() command. Some uses of the old hack are still floating around. Note that the purpose is to test if the variable named by "${VAR}" is defined, not whether the variable "VAR" itself is defined. -Brad _______________________________________________ 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