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