[CMake] Cmake inline macro?
Jack Kelly
endgame.dos at gmail.com
Sat Sep 15 19:01:21 EDT 2007
Dizzy wrote:
>> I couldn't find one, so I ported AC_C_INLINE to CMake. Since there's no
>> equivalent of autoheader to make the config.h.in, I just used
>> ADD_DEFINITIONS.
>
> There is such a thing, you use configure_file() to replace variables from
> a "config.h.in" (tho I name them usually "config.h.cmake") or #cmakedefine
> placeholders. See the cmake man page on CONFIGURE_FILE.
>
> Create a "config.h.cmake" with the following contents:
> #define inline ${INLINE_KEYWORD}
>
> Use it with configure_file(config.h.cmake config.h) and make sure you
> include "config.h" in your code.
>
> That is of couse assuming that the variable holding the inline keyword (or ""
> if there is no inline supported) is named INLINE_KEYWORD. Many macros output
> their result into a user given variable so it fits well in the cmake style.
>
You misunderstand me. autoheader can create the config.h.in based on the
calls made in the configure.ac file whereas CMake has to manually
specify a file to be used for CONFIGURE_FILE.
-- Jack
More information about the CMake
mailing list