On Thursday 26 March 2009, Carlson Daniel wrote: > I have now created a toolchain file which looks like this > (c:\temp\cmake\TC_diab.cmake): > > set(CMAKE_MODULE_PATH "c:/temp/cmake/Modules" ${CMAKE_MODULE_PATH}) > set(CMAKE_SYSTEM_NAME Generic) > set(CMAKE_C_COMPILER "C:/DIAB/5.6.0.0/WIN32/bin/dcc.exe") > set(CMAKE_SYSTEM_PROCESSOR "MPC5566") > > The compiler demands a target processor so to be able to perform the > "compiler test" during the compiler identification I had to add a platform > file (c:\temp\cmake\Modules\Platform\generic-dcc-MPC5566.cmake): > > set(CMAKE_C_FLAGS_INIT "-tPPCE200Z6NEG") > > Now, when I run Cmake on this very simple CmakeLists.txt > > cmake_minimum_required(VERSION 2.6.0) > project(Foo C) > > I get the following error: > > -- The C compiler identification is unknown > -- Check for working C compiler: C:/DIAB/5.6.0.0/WIN32/bin/dcc.exe > -- Check for working C compiler: C:/DIAB/5.6.0.0/WIN32/bin/dcc.exe -- works > -- Detecting C compiler ABI info > -- Detecting C compiler ABI info - done > -- Configuring done > You have changed variables that require your cache to be deleted. > Configure will be re-run and you may have to reset some variables. > The following variables have changed: > CMAKE_C_COMPILER= C:/Scania/ProgramsForBuild/MinGW/5.1.4/bin/gcc.exe > > -- The C compiler identification is GNU > -- Check for working C compiler: C:/MinGW/5.1.4/bin/gcc.exe > -- Check for working C compiler: C:/MinGW/5.1.4/bin/gcc.exe -- works > -- Detecting C compiler ABI info > -- Detecting C compiler ABI info - done > -- Configuring done > -- Generating done > -- Build files have been written to: > Z:/ssscde-vsd-ne-sw/eec3/02/output/make > > What have I done wrong? What variable have I changed?
Did you add the toolchain file to an existing build tree ? At least the output says first: -- Check for working C compiler: C:/DIAB/5.6.0.0/WIN32/bin/dcc.exe and later on: CMAKE_C_COMPILER= C:/Scania/ProgramsForBuild/MinGW/5.1.4/bin/gcc.exe Also, please apply the attached patch to your cmake, then it should say "The C compiler identification is Diab" With this you can then add files which set variables specific for your compiler in files like Generic-Diab-C.cmake and Generic-Diab-CXX.cmake Alex
Index: CMakeCCompilerId.c.in =================================================================== RCS file: /cvsroot/CMake/CMake/Modules/CMakeCCompilerId.c.in,v retrieving revision 1.4 diff -b -u -p -r1.4 CMakeCCompilerId.c.in --- CMakeCCompilerId.c.in 7 Aug 2008 13:09:45 -0000 1.4 +++ CMakeCCompilerId.c.in 26 Mar 2009 21:05:48 -0000 @@ -52,6 +52,10 @@ #elif defined(SDCC) # define COMPILER_ID "SDCC" +/* The WindRiver Diab C/C++ compiler */ +#elif defined(__DCC__) +# define COMPILER_ID "Diab" + #elif defined(_COMPILER_VERSION) # define COMPILER_ID "MIPSpro" Index: CMakeCXXCompilerId.cpp.in =================================================================== RCS file: /cvsroot/CMake/CMake/Modules/CMakeCXXCompilerId.cpp.in,v retrieving revision 1.3 diff -b -u -p -r1.3 CMakeCXXCompilerId.cpp.in --- CMakeCXXCompilerId.cpp.in 7 Aug 2008 13:09:45 -0000 1.3 +++ CMakeCXXCompilerId.cpp.in 26 Mar 2009 21:05:48 -0000 @@ -43,6 +43,10 @@ SHARC (21000) DSPs */ # define COMPILER_ID "ADSP" +/* The WindRiver Diab C/C++ compiler */ +#elif defined(__DCC__) +# define COMPILER_ID "Diab" + #elif defined(_COMPILER_VERSION) # define COMPILER_ID "MIPSpro"
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake