Hi Trevor, On Saturday 16 June 2007 11:27, Trevor Kellaway wrote: > Alex, > > > Please update to current cvsand use "Generic" as > > CMAKE_SYSTEM_NAME, there is now a Generic.cmake in cmake. > > > > ... > > > > > > SET (CMAKE_C_OUTPUT_EXTENSION ".o" CACHE STRING "C ...") > > > > SET (CMAKE_CXX_OUTPUT_EXTENSION ".o" CACHE STRING "C++ ...") > > > > > > > > > > > > Let me see if I find a way to define this later. > > > > > > > > > > > > SET (CMAKE_C_COMPILER_ID_RUN TRUE) > > > > SET (CMAKE_CXX_COMPILER_ID_RUN TRUE) > > > > SET (CMAKE_C_OUTPUT_EXTENSION ".o" CACHE STRING "C ...") > > SET (CMAKE_CXX_OUTPUT_EXTENSION ".o" CACHE STRING "C++ ...") > > SET (CMAKE_C_COMPILER_WORKS TRUE) > > SET (CMAKE_CXX_COMPILER_WORKS TRUE) > > ... > > SET (CMAKE_SIZEOF_VOID_P 2) > > SET (HAVE_CMAKE_SIZEOF_VOID_P TRUE) > > > > With current cvs you should be able to move the 6 variables > > above into Generic-chc12.cmake. > > The _ID_RUN variables still have to stay in the toolchain file. > > Moved values as above and tried rebuilding with cmake version > 2.5-20070615 and all is OK (example project tree attached FYI). > > Note, I'm still using "Freescale" for CMAKE_SYSTEM_NAME rather than > "Generic", as I still think this makes more sense to avoid potential > clashes of compiler names from different embedded compiler vendors. A > side benefit is its much easier for a user to spot their vendor's > compiler by vendor name rather than having to find what the compiler is > called.
Please have a look at the attached file and put it into your cmake/Modules/ directory and let me know what you think. It includes three simple macros, with these you can change your toolchain file to: include(CMakeForceCompiler) # force system name, version and processor cmake_force_system("Generic" "1.0" "hc12") # this one sets the compiler to "chc12", the sizeof(void) to 2 # and the "compiler id" to "FreescaleCHC12". # With a compiler id cmake will try to load # ${CMAKE_SYSTEM_NAME}-${ID}-C.cmake for C and # ${CMAKE_SYSTEM_NAME}-${ID}-CXX.cmake for C++ cmake_force_c_compiler(chc12 FreescaleCHC12 2) # same for C++, the size is not needed here cmake_force_cxx_compiler(chc12 FreescaleCHC12) ------------------------------------------------------------- Can't you move the following three also in the toolchain file ? If they are already in the cache, you could try the FORCE option. SET (HC12_PIPER "piper" CACHE STRING "Freescale tool...") SET (CMAKE_AR "libmaker" CACHE STRING "Tool chain library archiver") SET (CMAKE_LINKER "linker" CACHE STRING "Tool chain linker") Alex
MACRO(CMAKE_FORCE_SYSTEM name version proc) SET(CMAKE_SYSTEM_NAME "${name}") SET(CMAKE_SYSTEM_VERSION "${version}") SET(CMAKE_SYSTEM_PROCESSOR "${proc}") ENDMACRO(CMAKE_FORCE_SYSTEM) MACRO(CMAKE_FORCE_C_COMPILER compiler id sizeof_void) SET(CMAKE_C_COMPILER "${compiler}") SET(CMAKE_C_COMPILER_ID_RUN TRUE) SET(CMAKE_C_COMPILER_ID ${id}) SET(CMAKE_C_COMPILER_WORKS TRUE) SET(CMAKE_SIZEOF_VOID_P ${sizeof_void} CACHE STRING "sizeof void") SET(HAVE_CMAKE_SIZEOF_VOID_P TRUE CACHE INTERNAL "have sizeof void") ENDMACRO(CMAKE_FORCE_C_COMPILER) MACRO(CMAKE_FORCE_CXX_COMPILER compiler id) SET(CMAKE_CXX_COMPILER "${compiler}") SET(CMAKE_CXX_COMPILER_ID_RUN TRUE) SET(CMAKE_CXX_COMPILER_ID ${id}) SET(CMAKE_CXX_COMPILER_WORKS TRUE) ENDMACOo(CMAKE_FORCE_CXX_COMPILER)
_______________________________________________ CMake mailing list CMake@cmake.org http://www.cmake.org/mailman/listinfo/cmake