<div dir="ltr">I am trying to use a macro to enable c99 in some of my cmake modules.<div><br></div><div>In the top level cmake file I add this macro</div><div><br></div><div><div>macro(use_c99)</div><div>  if (CMAKE_VERSION VERSION_LESS "3.1")</div><div>    if (CMAKE_C_COMPILER_ID STREQUAL "GNU")</div><div>      set (CMAKE_C_FLAGS "--std=gnu99 ${CMAKE_C_FLAGS}")</div><div>    endif ()</div><div>  else ()</div><div>    set (CMAKE_C_STANDARD 99)</div><div>  endif ()</div><div>endmacro(use_c99)</div></div><div><br></div><div>then in another CMakeLists.txt file I add </div><div>use_c99()</div><div><br></div><div>but I get this error:</div><div><br></div><div><div>CMake Error at source/internal_src/cube/CMakeLists.txt:1 (use_c</div><div>99):</div><div>  Unknown CMake command "use_c99".</div><div><br></div><div>why am I unable to use the macro? My main cmake is using 3.0.2 from debian repository.</div><div><br></div></div></div>