cpp macro

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

cpp macro

Stéphane Ancelot
hi

is there a mactro for cpp ?

Regards,

S.Ancelot
--

Powered by 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
Reply | Threaded
Open this post in threaded view
|

Re: cpp macro

Eric Noulard


Le lun. 4 juin 2018 à 09:59, Stéphane Ancelot <[hidden email]> 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.

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

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

--

Powered by 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
Reply | Threaded
Open this post in threaded view
|

Re: cpp macro

Petr Kmoch
On 4 June 2018 at 10:16, Eric Noulard <[hidden email]> wrote:


In both cases I don't know how to discover that in a cross-platform way.
Probably MSVC has another option for pre-processsing.

The basic option is /P, with related options /EP and /C which control line numbering, comment suppression etc.

Petr


On 4 June 2018 at 10:16, Eric Noulard <[hidden email]> wrote:


Le lun. 4 juin 2018 à 09:59, Stéphane Ancelot <[hidden email]> 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.

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

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

--

Powered by 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



--

Powered by 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
Reply | Threaded
Open this post in threaded view
|

Re: cpp macro

Stéphane Ancelot
In reply to this post by Eric Noulard



Le 04/06/2018 à 10:16, Eric Noulard a écrit :


Le lun. 4 juin 2018 à 09:59, Stéphane Ancelot <[hidden email]> 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

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


--

Powered by 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
Reply | Threaded
Open this post in threaded view
|

Re: cpp macro

Bill Hoffman
With the makefile generator you can do make foo.cxx.i.  Sadly this
feature never made it into ninja.  If you run make help it shows the
targets available.  With VS IDE you can right click on a file and get it
to preprocess the file.

-Bill

--

Powered by 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