<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thank you.<br><br>I have tried to compile my code using that version of CMakeLists, but it doesn't work. My program's output is still wrong.<br><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div class="plainMail">This is completely, utterly wrong!<br><br><br># 2.7 was a development version, so you should either specify<br># 2.6 or 2.8...<br>cmake_minim_required(VERSION 2.7)<br>project(ITK_MPI)<br><br>find_package(MPI REQUIRED)<br><br>include_directories(${MPI_INCLUDE_PATH})<br><br>add_executable(hello hello.cpp)<br>target_link_libraries(hello ${MPI_LIBRARIES})<br><br>if(MPI_COMPILE_FLAGS)<br>&nbsp; set_target_properties(hello PROPERTIES<br>&nbsp; &nbsp; COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")<br>endif()<br><br>if(MPI_LINK_FLAGS)<br>&nbsp; set_target_properties(hello PROPERTIES<br>&nbsp; &nbsp; LINK_FLAGS
 "${MPI_LINK_FLAGS}")<br>endif()<br><br><br>You should *NEVER* set CMAKE_&lt;LANG&gt;_COMPILER, this completely breaks<br>things. Also, with CMake you shouldn't use the compiler wrappers (mpicxx<br>etc.), because CMake figures out how to compile MPI programs without it.<br><br>HTH<br><br>Michael<br></div></blockquote></td></tr></table>