Re: [CMake] Macro for adding cflags, odd quirk with CHECK_C_COMPILER_FLAG

2010-12-20 Thread Brad King
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 bu

[CMake] Macro for adding cflags, odd quirk with CHECK_C_COMPILER_FLAG

2010-12-16 Thread Campbell Barton
Hi, we were having some problems with warnings and gcc versions so I thought to write a macro that adds a flag to any string (typically CMAKE_C_FLAGS) ADD_CHECK_C_COMPILER_FLAG(CMAKE_C_FLAGS -Wno-unknown-pragmas) ...this is the macro. macro(ADD_CHECK_C_COMPILER_FLAG _CFLAGS _FLAG