Toolchain with non-gcc argument format

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

Toolchain with non-gcc argument format

oliver.zabel
Hi,

i have some modules which i want to cross-compile for different platforms which uses different compilers. One of them for example is the arm-gcc compiler which works over the toolchain file.
Now i have a Renesas RX compiler which uses for example instead of "-I" for include paths the argument "-include=". So using this toolchain fails because cmake trys to use gcc arguments.

I managed to compile my modules with the following approache:

set(CMAKE_C_COMPILER_WORKS 1)
project(MyModule C)
cmake_minimum_required(VERSION 3.0)

set(EXECUTABLE_NAME MyModule)
set(SRC_FILES
        ${PROJECT_SOURCE_DIR}/module.c
        ${PROJECT_SOURCE_DIR}/main.c
)

IF(RXCOMPILER)
  MESSAGE(STATUS "RX Mode")
  add_custom_target(dummy_target ALL DEPENDS EXECUTABLE_NAME)
 
  ADD_CUSTOM_COMMAND(
    OUTPUT    EXECUTABLE_NAME
    COMMAND   ${CMAKE_C_COMPILER}
    ARGS      -output=obj=abs -cpu=rx200 -lang=c99 -goptimize -size ${SRC_FILES}
    COMMENT   "RX Compiler"
  )
ELSE(RXCOMPILER)

        add_executable(EXECUTABLE_NAME ${SRC_FILES})
       
ENDIF(RXCOMPILER)

Is there a better way of doing this? For example telling cmake to use "-include=" instaed of "-I"?

Thanks for your help!


Best regards,
oliver
--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Toolchain with non-gcc argument format

oliver.zabel

Hi,

No one any idea?

Thanks!

--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Toolchain with non-gcc argument format

Konstantin Tokarev


14.11.2017, 12:37, "[hidden email]" <[hidden email]>:
> Hi,
>
> No one any idea?

Look into Modules/Compiler directory of CMake installation, it implements support for many different compilers

>
> Thanks!
>
> --
>
> 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:
> http://public.kitware.com/mailman/listinfo/cmake

--
Regards,
Konstantin
--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Toolchain with non-gcc argument format

oliver.zabel

Hi,

Thank you. There is unfortunately not the right toolchain there - according
my question I do have my toolchain Running - but with a custom command and
I would like to know whether there is a better way.

Cheers!

--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Toolchain with non-gcc argument format

Konstantin Tokarev


14.11.2017, 15:32, "[hidden email]" <[hidden email]>:
> Hi,
>
> Thank you. There is unfortunately not the right toolchain there - according
> my question I do have my toolchain Running - but with a custom command and
> I would like to know whether there is a better way.

I meant you can use this files as an example and make correct file for your toolchain.

E.g. see how TI-C.cmake sets CMAKE_INCLUDE_FLAG_C

>
> Cheers!

--
Regards,
Konstantin
--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Toolchain with non-gcc argument format

oliver.zabel

Hi,

Sorry - I don’t get the hint :) thanks, I will look into it!

Cheers!
Oliver
--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Antwort: Re: Toolchain with non-gcc argument format

oliver.zabel
Hi,

i tried now, to setup correctly the toolchain with your help and the existing toolchain-files but cmake is not replacing "-I" to "-include="

set(CMAKE_INCLUDE_FLAG_C "--include=" FORCE)
set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> -output=obj -cpu=rx200 -lang=c99 -goptimize -size <INCLUDES> <DEFINES> <FLAGS> <SOURCE>")

The resulting output is: ccrx.exe -output=obj -cpu=rx200 -lang=c99 -goptimize -size -IC:\Users\....

Is there something other that has to be set?

Thanks!



Von:        [hidden email]
An:        "Konstantin Tokarev" <[hidden email]>
Kopie:        CMake users <[hidden email]>
Datum:        14.11.2017 13:42
Betreff:        Re: [CMake] Toolchain with non-gcc argument format
Gesendet von:        "CMake" <[hidden email]>





Hi,

Sorry - I don’t get the hint :) thanks, I will look into it!

Cheers!
Oliver
--

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:
http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Re: Toolchain with non-gcc argument format

Konstantin Tokarev


> Hi,
>
> i tried now, to setup correctly the
> toolchain with your help and the existing toolchain-files but cmake is
> not replacing "-I" to "-include="
>
> set(CMAKE_INCLUDE_FLAG_C "--include="
> FORCE)
>
> set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER>
> -output=obj -cpu=rx200 -lang=c99 -goptimize -size <INCLUDES> <DEFINES>
> <FLAGS> <SOURCE>")
>
> The resulting output is: ccrx.exe -output=obj
> -cpu=rx200 -lang=c99 -goptimize -size -IC:\Users\....
>
> Is there something other that has to
> be set?

Are you writing this in toolchain file, or you created another module in Modules/Compiler?

>
> Thanks!
>
> Von:
> [hidden email]
>
> An:
> "Konstantin Tokarev"
> <[hidden email]>
>
> Kopie:
> CMake users <[hidden email]>
>
> Datum:
> 14.11.2017 13:42
>
> Betreff:
> Re: [CMake]
> Toolchain with non-gcc argument format
>
> Gesendet von:
> "CMake"
> <[hidden email]>
>
> Hi,
>
> Sorry - I don’t get the hint :) thanks, I will look into it!
>
> Cheers!
>
> Oliver
>
> --
>
> 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:
>
> http://public.kitware.com/mailman/listinfo/cmake
--
Regards,
Konstantin
--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Antwort: Re:Antwort: Re: Toolchain with non-gcc argument format

oliver.zabel
> Are you writing this in toolchain file, or you created another module in Modules/Compiler?

I wrote this in my toolchain-file.



Von:        Konstantin Tokarev <[hidden email]>
An:        [hidden email]
Kopie:        CMake users <[hidden email]>, CMake <[hidden email]>
Datum:        15.11.2017 12:04
Betreff:        Re:Antwort: Re: [CMake] Toolchain with non-gcc argument format






> Hi,
>
> i tried now, to setup correctly the
> toolchain with your help and the existing toolchain-files but cmake is
> not replacing "-I" to "-include="
>
> set(CMAKE_INCLUDE_FLAG_C "--include="
> FORCE)
>
> set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER>
> -output=obj -cpu=rx200 -lang=c99 -goptimize -size <INCLUDES> <DEFINES>
> <FLAGS> <SOURCE>")
>
> The resulting output is: ccrx.exe -output=obj
> -cpu=rx200 -lang=c99 -goptimize -size -IC:\Users\....
>
> Is there something other that has to
> be set?

Are you writing this in toolchain file, or you created another module in Modules/Compiler?

>
> Thanks!
>
> Von:
> [hidden email]
>
> An:
> "Konstantin Tokarev"
> <[hidden email]>
>
> Kopie:
> CMake users <[hidden email]>
>
> Datum:
> 14.11.2017 13:42
>
> Betreff:
> Re: [CMake]
> Toolchain with non-gcc argument format
>
> Gesendet von:
> "CMake"
> <[hidden email]>
>
> Hi,
>
> Sorry - I don’t get the hint :) thanks, I will look into it!
>
> Cheers!
>
> Oliver
>
> --
>
> 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:
>
>
http://public.kitware.com/mailman/listinfo/cmake
--
Regards,
Konstantin



--

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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Antwort: Antwort: Re:Antwort: Re: Toolchain with non-gcc argument format

oliver.zabel
I did not find the CMAKE_INCLUDE_FLAG_C in the CMake cache - is it possible that this is somehow ignored?



Von:        [hidden email]
An:        Konstantin Tokarev <[hidden email]>
Kopie:        CMake users <[hidden email]>, CMake <[hidden email]>
Datum:        15.11.2017 12:34
Betreff:        [CMake] Antwort: Re:Antwort: Re: Toolchain with non-gcc argument        format
Gesendet von:        "CMake" <[hidden email]>




> Are you writing this in toolchain file, or you created another module in Modules/Compiler?

I wrote this in my toolchain-file.




Von:        
Konstantin Tokarev <[hidden email]>
An:        
[hidden email]
Kopie:        
CMake users <[hidden email]>, CMake <[hidden email]>
Datum:        
15.11.2017 12:04
Betreff:        
Re:Antwort: Re: [CMake] Toolchain with non-gcc argument format






> Hi,
>
> i tried now, to setup correctly the
> toolchain with your help and the existing toolchain-files but cmake is
> not replacing "-I" to "-include="
>
> set(CMAKE_INCLUDE_FLAG_C "--include="
> FORCE)
>
> set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER>
> -output=obj -cpu=rx200 -lang=c99 -goptimize -size <INCLUDES> <DEFINES>
> <FLAGS> <SOURCE>")
>
> The resulting output is: ccrx.exe -output=obj
> -cpu=rx200 -lang=c99 -goptimize -size -IC:\Users\....
>
> Is there something other that has to
> be set?

Are you writing this in toolchain file, or you created another module in Modules/Compiler?

>
> Thanks!
>
> Von:
> [hidden email]
>
> An:
> "Konstantin Tokarev"
> <[hidden email]>
>
> Kopie:
> CMake users <[hidden email]>
>
> Datum:
> 14.11.2017 13:42
>
> Betreff:
> Re: [CMake]
> Toolchain with non-gcc argument format
>
> Gesendet von:
> "CMake"
> <[hidden email]>
>
> Hi,
>
> Sorry - I don’t get the hint :) thanks, I will look into it!
>
> Cheers!
>
> Oliver
>
> --
>
> 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:
>
>
http://public.kitware.com/mailman/listinfo/cmake
--
Regards,
Konstantin


--

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:
http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Antwort: Re:Antwort: Re: Toolchain with non-gcc argument format

Eric Noulard
Hi Olivier,

Putting the list back.
You may try developer list as well.


2017-11-22 9:02 GMT+01:00 <[hidden email]>:
Hi,

Is there really no way to override this var with a toolchain file? that seems somehow strange to me, since CMAKE is so configurable that i can't change "-I" to "-include=" .... what do i have to do?


I'm sorry I'm a little short in time to investigate that with you at the moment and I hope some other people may step in.
The var "CMAKE_INCLUDE_FLAG_C" is NOT a toolchain file variable and it won't end-up in the cache file.
AFAIK It is **only** used in compiler detection, e.g. at early stage of project configuration when processing project(...)
or enable_language(..)

Adding new toolchain is not as flexible as adding a new **kind** of compiler.
The knobs accessing for writing a toolchain are described here:

There you can see that:
"Languages are enabled by the project() command. Language-specific built-in variables, such as CMAKE_CXX_COMPILER, CMAKE_CXX_COMPILER_ID etc are set by invoking the project() command."

Unless I'm wrong the toolchain mechanism does not include the capability to change "-I" to "-include".

Now adding a new "kind" of compiler, a.k.a. compiler ID, enables you to specify that include directive flag is " -include" (and many other things as well)
Adding a new compiler ID requires to add files in 

as you can see it requires at least a couple of file to find a compiler and one file per supported language (C, CXX, etc...)
in the C or CXX specific file you may use CMAKE_INCLUDE_FLAG_C and other variables:

see e.g.:

I did never add a new kind of compiler so I hope people with more knowlegde than me in this area will explain that part better than me.

Eric

 



2017-11-16 9:44 GMT+01:00 <[hidden email]>:
I did not find the CMAKE_INCLUDE_FLAG_C in the CMake cache - is it possible that this is somehow ignored?

This variable is used by CMake **builtin compiler** discovery and configuration.
The file are are put in "Modules/Compiler" there is one per-langage and per-compiler ID:
https://cmake.org/cmake/help/v3.7/variable/CMAKE_LANG_COMPILER_ID.html

I don't know the exact processing order of this set of files.

Toolchain files:
https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html
does not use or contain such variables.

--

Eric




--
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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Antwort: Re: Re: Antwort: Antwort: Re:Antwort: Re: Toolchain with non-gcc argument format

oliver.zabel
Hi Eric,

thanks a lot for your help! i'm going to try it on the dev mailing list.

Cheers,
Oliver



Von:        Eric Noulard <[hidden email]>
An:        [hidden email]
Kopie:        CMake Mailinglist <[hidden email]>
Datum:        22.11.2017 09:49
Betreff:        Re: Re: [CMake] Antwort: Antwort: Re:Antwort: Re: Toolchain with non-gcc argument format




Hi Olivier,

Putting the list back.
You may try developer list as well.


2017-11-22 9:02 GMT+01:00 <oliver.zabel@...>:
Hi,

Is there really no way to override this var with a toolchain file? that seems somehow strange to me, since CMAKE is so configurable that i can't change "-I" to "-include=" .... what do i have to do?



I'm sorry I'm a little short in time to investigate that with you at the moment and I hope some other people may step in.
The var "CMAKE_INCLUDE_FLAG_C" is NOT a toolchain file variable and it won't end-up in the cache file.
AFAIK It is **only** used in compiler detection, e.g. at early stage of project configuration when processing project(...)
or enable_language(..)

Adding new toolchain is not as flexible as adding a new **kind** of compiler.
The knobs accessing for writing a toolchain are described here:
https://cmake.org/cmake/help/v3.10/manual/cmake-toolchains.7.html

There you can see that:
"Languages are enabled by the project() command. Language-specific built-in variables, such as CMAKE_CXX_COMPILER, CMAKE_CXX_COMPILER_ID etc are set by invoking the project() command."

Unless I'm wrong the toolchain mechanism does not include the capability to change "-I" to "-include".

Now adding a new "kind" of compiler, a.k.a. compiler ID, enables you to specify that include directive flag is " -include" (and many other things as well)
Adding a new compiler ID requires to add files in 
<CMakePrefix>/Modules/Compiler (see https://github.com/Kitware/CMake/tree/master/Modules/Compiler)

as you can see it requires at least a couple of file to find a compiler and one file per supported language (C, CXX, etc...)
in the C or CXX specific file you may use CMAKE_INCLUDE_FLAG_C and other variables:

see e.g.:
https://github.com/Kitware/CMake/blob/master/Modules/Compiler/TI-C.cmake 

I did never add a new kind of compiler so I hope people with more knowlegde than me in this area will explain that part better than me.

Eric

 



2017-11-16 9:44 GMT+01:00 <
oliver.zabel@...>:
I did not find the CMAKE_INCLUDE_FLAG_C in the CMake cache - is it possible that this is somehow ignored?


This variable is used by CMake **builtin compiler** discovery and configuration.
The file are are put in "Modules/Compiler" there is one per-langage and per-compiler ID:

https://cmake.org/cmake/help/v3.7/variable/CMAKE_LANG_COMPILER_ID.html

I don't know the exact processing order of this set of files.

Toolchain files:

https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html
does not use or contain such variables.

--
Eric




--
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:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: Antwort: Re: Re: Antwort: Antwort: Re:Antwort: Re: Toolchain with non-gcc argument format

Anders Lindgren
Hi!

One solution is to write a wrapper script in your favourite scripting language (Ruby, Python etc) that pretend that it's a compiler. It could recognise the -I option and start the RX compiler with the --include option. It would not hurt to make it recognise other standard flags like "-o" and "-c" in case the RX compiler doesn't support them either.

    -- Anders

On Wed, Nov 22, 2017 at 10:33 AM, <[hidden email]> wrote:
Hi Eric,

thanks a lot for your help! i'm going to try it on the dev mailing list.

Cheers,
Oliver



Von:        Eric Noulard <[hidden email]>
An:        [hidden email]
Kopie:        CMake Mailinglist <[hidden email]>
Datum:        22.11.2017 09:49
Betreff:        Re: Re: [CMake] Antwort: Antwort: Re:Antwort: Re: Toolchain with non-gcc argument format




Hi Olivier,

Putting the list back.
You may try developer list as well.


2017-11-22 9:02 GMT+01:00 <[hidden email]>:
Hi,

Is there really no way to override this var with a toolchain file? that seems somehow strange to me, since CMAKE is so configurable that i can't change "-I" to "-include=" .... what do i have to do?



I'm sorry I'm a little short in time to investigate that with you at the moment and I hope some other people may step in.
The var "CMAKE_INCLUDE_FLAG_C" is NOT a toolchain file variable and it won't end-up in the cache file.
AFAIK It is **only** used in compiler detection, e.g. at early stage of project configuration when processing project(...)
or enable_language(..)

Adding new toolchain is not as flexible as adding a new **kind** of compiler.
The knobs accessing for writing a toolchain are described here:
https://cmake.org/cmake/help/v3.10/manual/cmake-toolchains.7.html

There you can see that:
"Languages are enabled by the project() command. Language-specific built-in variables, such as CMAKE_CXX_COMPILER, CMAKE_CXX_COMPILER_ID etc are set by invoking the project() command."

Unless I'm wrong the toolchain mechanism does not include the capability to change "-I" to "-include".

Now adding a new "kind" of compiler, a.k.a. compiler ID, enables you to specify that include directive flag is " -include" (and many other things as well)
Adding a new compiler ID requires to add files in 
<CMakePrefix>/Modules/Compiler (see https://github.com/Kitware/CMake/tree/master/Modules/Compiler)

as you can see it requires at least a couple of file to find a compiler and one file per supported language (C, CXX, etc...)
in the C or CXX specific file you may use CMAKE_INCLUDE_FLAG_C and other variables:

see e.g.:
https://github.com/Kitware/CMake/blob/master/Modules/Compiler/TI-C.cmake 

I did never add a new kind of compiler so I hope people with more knowlegde than me in this area will explain that part better than me.

Eric

 



2017-11-16 9:44 GMT+01:00 <
[hidden email]>:
I did not find the CMAKE_INCLUDE_FLAG_C in the CMake cache - is it possible that this is somehow ignored?


This variable is used by CMake **builtin compiler** discovery and configuration.
The file are are put in "Modules/Compiler" there is one per-langage and per-compiler ID:

https://cmake.org/cmake/help/v3.7/variable/CMAKE_LANG_COMPILER_ID.html

I don't know the exact processing order of this set of files.

Toolchain files:

https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html
does not use or contain such variables.

--
Eric




--
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:
http://public.kitware.com/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:
http://public.kitware.com/mailman/listinfo/cmake