Oh, there is a "CMAKE_CXX_LINK_EXECUTABLE". That variable I did not know. It is nice to see that one does not need to force the compiler. That would be a bit nasty. :-)
This feature seems to come along with the 2.8.11 release which is in the door. I will try to write a blog post about this once we have the new release. :) Thank you for pointing this merge out. On Tue, Mar 12, 2013 at 9:09 AM, Florian Reinhard < florian.reinh...@googlemail.com> wrote: > 1. drop the TI_DSP*.cmake you can find linked below in your > cmake/Modules/Compiler folder, i assumed this was already released > since Alexander Neundorf merged the changes back in november > > > http://cmake.org/gitweb?p=cmake.git;a=tree;f=Modules/Compiler;h=34a0ad1a5694082dc8ffc62c2ebeaa446ea09274;hb=master > > > 2. set your compiler in the following way, just replace/set CGT_DIR. > as you can see from the comment, the commands are sensible to the > order: > SET (CMAKE_C_COMPILER "${CGT_DIR}/bin/cl6x.exe") > SET (CMAKE_CXX_COMPILER ${CMAKE_C_COMPILER}) > SET (CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) > SET (CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_COMPILER}) > SET (CMAKE_STRIP "${CGT_DIR}/bin/strip6x.exe") > > # We do want to compile assembler files as well > ENABLE_LANGUAGE(ASM) > > # must be done after enabling ASM since it overwrites CMAKE_AR > SET (CMAKE_AR "${CGT_DIR}/bin/ar6x.exe") > > > 3. if you encounter problems while cmake does compiler tests add the > following > SET (CMAKE_C_COMPILER_WORKS 1) > SET (CMAKE_CXX_COMPILER_WORKS 1) > #skip ABI checks > SET (CMAKE_DETERMINE_C_ABI_COMPILED 1) > SET (CMAKE_DETERMINE_CXX_ABI_COMPILED 1) > SET (CMAKE_DETERMINE_ASM_ABI_COMPILED 1) > > in my case on windows 7 with cl6x 6.2.*, cmake would just crash. i > think this is what you encounter as well. maybe jom just hides that > crash. unfortunately i have not the knowledge to investigate this on > windows. > > 4. if you compile libraries as well you might need the following: > UNSET (CMAKE_C_ARCHIVE_FINISH) > UNSET (CMAKE_CXX_ARCHIVE_FINISH) > > Kind Regards, > > Florian Reinhard > > 2013/2/22 Laszlo Papp <lp...@kde.org>: > > Hi, > > > > I am now trying to put a toolchain file together for the aforementioned > > embedded environment on my Windows 7 workstation. You can see the file > > contents I have, and the errors I get below. When I just use the compiler > > against the one liner main.c, it works off hand. I also tried to force > the > > C/C++ compilers, but even though the cmake ran fine, jom failed pretty > much > > with the same error. > > > > Any help is much appreciated! > > > > Laszlo > > > > ----------------------------------------------------------------- > > > > main.c > > > > int main() {return 0;} > > > > CMakeLists.txt > > > > add_executable(skeleton main.c) > > > > ToolchainFile-C6000 > > > > # include("CMakeForceCompiler") > > > > set(CMAKE_SYSTEM_NAME "Sysbios") > > set(CMAKE_SYSTEM_VERSION "1.0") > > set(CMAKE_SYSTEM_PROCESSOR "C6000") > > > > set(CMAKE_FIND_ROOT_PATH "${CMAKE_FIND_ROOT_PATH}" > > "C:/ti/C6000 Code Generation Tools 7.3.0B3/bin" > > "C:/ti/C6000 Code Generation Tools 7.3.0B3/include" > > "C:/ti/C6000 Code Generation Tools 7.3.0B3/lib") > > > > # CMAKE_FORCE_C_COMPILER("C:/ti/C6000 Code Generation Tools > > 7.3.0B3/bin/cl6x.exe" "TI") > > # CMAKE_FORCE_CXX_COMPILER("C:/ti/C6000 Code Generation Tools > > 7.3.0B3/bin/cl6x.exe" "TI") > > > > SET(CMAKE_C_COMPILER "C:/ti/C6000 Code Generation Tools > > 7.3.0B3/bin/cl6x.exe") > > SET(CMAKE_CXX_COMPILER "C:/ti/C6000 Code Generation Tools > > 7.3.0B3/bin/cl6x.exe") > > > > set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) > > set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) > > set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) > > > > ERROR > > > > cmake -G "NMake Makefiles JOM" > > -DCMAKE_TOOLCHAIN_FILE=../toolchain-cl6x.cmake .. > > -- The C compiler identification is TI_DSP 7.3.0 > > -- The CXX compiler identification is TI_DSP 7.3.0 > > -- Check for working C compiler: C:/ti/C6000 Code Generation Tools > > 7.3.0B3/bin/c > > l6x.exe > > -- Check for working C compiler: C:/ti/C6000 Code Generation Tools > > 7.3.0B3/bin/c > > l6x.exe -- broken > > CMake Error at C:/Program Files (x86)/CMake > > 2.8/share/cmake-2.8/Modules/CMakeTes > > tCCompiler.cmake:61 (message): > > The C compiler "C:/ti/C6000 Code Generation Tools > 7.3.0B3/bin/cl6x.exe" is > > not able to compile a simple test program. > > > > It fails with the following output: > > > > Change Dir: C:/Projects/share/skeleton/build/CMakeFiles/CMakeTmp > > > > > > > > Run Build Command:jom "cmTryCompileExec2474985119\fast" > > > > > > > > jom 1.0.13 - empower your cores > > > > > > > > "C:\Program Files (x86)\jom\jom.exe" -f > > CMakeFiles\cmTryCompileExec2474985119.dir\build.make /nologo - > > CMakeFiles\cmTryCompileExec2474985119.dir\build > > > > "C:\Program Files (x86)\CMake 2.8\bin\cmake.exe" -E > > cmake_progress_repor > > t > > C:\Projects\share\skeleton\build\CMakeFiles\CMakeTmp\CMakeFiles 1 > > > > Building C object > > CMakeFiles/cmTryCompileExec2474985119.dir/testCCompiler.c.obj > > > > C:\ti\C6000C~1.0B3\bin\cl6x.exe -o > > CMakeFiles\cmTryCompileExec2474985119.dir\testCCompiler.c.obj -c > > C:\Projects\share\skeleton\build\CMakeFiles\CMakeTmp\testCCompiler.c > > > > [testCCompiler.c] > > > > >> WARNING: object file specified, but linking not enabled > > > > Linking C executable cmTryCompileExec2474985119 > > > > C:\ti\C6000C~1.0B3\bin\cl6x.exe > > "CMakeFiles\cmTryCompileExec2474985119.dir\testCCompiler.c.obj" -o > > cmTryCompileExec2474985119 > > > > [cmTryCompileExec2474985119.] > > > > >> WARNING: object file specified, but linking not enabled > > > > Fatal error: could not open source file "cmTryCompileExec2474985119" > > > > 1 fatal error detected in the compilation of > "cmTryCompileExec2474985119". > > > > Compilation terminated. > > > > > > > > jom: > > > > > C:\Projects\share\skeleton\build\CMakeFiles\CMakeTmp\CMakeFiles\cmTryCompileEx > > ec2474985119.dir\build.make > > [cmTryCompileExec2474985119] Error 1 > > > > >> Compilation failure > > > > jom: C:\Projects\share\skeleton\build\CMakeFiles\CMakeTmp\Makefile > > [cmTryCompileExec2474985119\fast] Error 2 > > > > > > > > > > > > CMake will not be able to correctly generate this project. > > Call Stack (most recent call first): > > > > > > > > -- Configuring incomplete, errors occurred! > > > > C:\Projects\share\skeleton\build> > > > > > > -- > > > > 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 >
-- 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