Toolchain with non-gcc argument format

classic Classic list List threaded Threaded
10 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