[CMake] cpp macro

Stéphane Ancelot sancelot at numalliance.com
Tue Jun 5 06:03:21 EDT 2018



Le 04/06/2018 à 10:16, Eric Noulard a écrit :
>
>
> Le lun. 4 juin 2018 à 09:59, Stéphane Ancelot 
> <sancelot at numalliance.com <mailto:sancelot at numalliance.com>> a écrit :
>
>     hi
>
>     is there a mactro for cpp ?
>
>
> You mean a CMake variable which would contain the path to C 
> preprocessor binary?
>
> I don't think so, at list no xxx_<LANG>_xxx variable seems to exists 
> for that.
> Did you check "cmake --help-variable-list" ?
>
> May be you can ask the compiler to act a the C pre-processor?
>
> clang and gcc both accept the '-E' command line option to only run the 
> preprocessor.
>
I used ${CMAKE_C_COMPILER} -E
> otherwise you may probably call
>
> find_program(C_PREPROCESSOR NAMES cpp)
>
> In both cases I don't know how to discover that in a cross-platform way.
> Probably MSVC has another option for pre-processsing.
>
> Eric
>
>
>     Regards,
>
>     S.Ancelot
>     -- 
>
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Please keep messages on-topic and check the CMake FAQ at:
>     http://www.cmake.org/Wiki/CMake_FAQ
>
>     Kitware offers various services to support the CMake community.
>     For more information on each offering, please visit:
>
>     CMake Support: http://cmake.org/cmake/help/support.html
>     CMake Consulting: http://cmake.org/cmake/help/consulting.html
>     CMake Training Courses: http://cmake.org/cmake/help/training.html
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Follow this link to subscribe/unsubscribe:
>     https://cmake.org/mailman/listinfo/cmake
>
>
>
> -- 
> Eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20180605/3ad7f257/attachment.html>


More information about the CMake mailing list