<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">

</div><style>
hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
<div style="text-align: left;">Hi there,<br><br><br><br>The attached file (multi-toolchain.patch.bz2) is a patch I made for supporting multiple tool-chain in single source tree.<br><br>The idea is add an extra property "TARGET_ARCH" to target <br>and make the variable expansion routine lookup toolchain according to TARGET_ARCH.<br><br>For example, if TARGET_ARCH is set as CPUX (ie: SET_TARGET_PROPERTIES(my_target&nbsp; PROPERTIES&nbsp; TARGET_ARCH&nbsp; CPUX) ), <br>the modified expansion routine will check CMAKE_C_COMPILER_CPUX first when cmake attempts to generate statements which reference to C compiler.<br><br>For heterogeneous computing  environment such as grid / clustering or Cell (the multiple core processor used in PS3), such support would be useful.<br><br><br>Besides the patch, two module files for supporting Cell SDK 3 are also attached.<br>Those modules would find toolchain binaries and adjust compiling rules for you.<br><br><br><br><br>Here is an example of CMakeList.txt for a HelloWorld in Cell:<br><br>First of all, the layout of source tree:<br>{{{<br>ProjectRoot $ ls -RF .<br>CMakeLists.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>spe/<br>ppe/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>toolchain.cmake<br><br>./ppe:<br>CMakeLists.txt&nbsp; <br>main_ppe.c<br><br>./spe:<br>CMakeLists.txt&nbsp; <br>main_spe.c<br><br>}}}<br><br>====<br>The CMakeList-s.<br><br>$ProjectRoot/CMakeList.txt<br>{{{<br><br>project (HELLOCELL)<br><br>add_subdirectory(spe)<br>add_subdirectory(ppe)<br><br>}}}<br><br>----<br><br>$ProjectRoot/ppe/CMakeList.txt<br>{{{<br>add_executable(ppe_helo main_ppe.c)<br>target_link_libraries(ppe_helo spe2)<br>target_link_libraries(ppe_helo pthread)<br>set_target_properties (ppe_helo PROPERTIES TARGET_ARCH&nbsp; PPU)<br><br>target_link_libraries(ppe_helo "${HELLOCELL_BINARY_DIR}/spe/Hello_CBE_SPE.a")<br><br>}}}<br><br>----<br><br>$ProjectRoot/spe/CMakeList.txt<br>
{{{<br>
add_executable (Hello_CBE_SPE main_spe.c)<br>set_target_properties (Hello_CBE_SPE PROPERTIES TARGET_ARCH SPU256K)<br>set_target_properties (Hello_CBE_SPE PROPERTIES ENABLE_EXPORTS 1)<br><br>make_embedspu(Hello_CBE_SPE)<br><br>}}}<br><br>====<br><br>The C files can be obtain from the example code directory of SDK.<br><br><br>I did not includes these codes.<br><br>Since there is a "All Rights Reserved" section on those sources ,<br>I am not sure about its appropriate or not to redistribute those hello world code here.<br><br>However, you can always download your own SDK copy for free if you really like to see those codes.<br><br><br><br>I am new to cmake :)<br><br>Please let me know if any problems or suggestions.<br><br>Thanks !!<br><br><br>Best regards,<br>&nbsp; Yinyin<br><br><br><br>----<br>EOF<br>.<br><br>--<br>Taiwan, a beautiful, warm and independent island country.<br></div><br /><hr />Explore the seven wonders of the world <a href='http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE' target='_new'>Learn more!</a></body>
</html>