<div dir="ltr"><div>And I did it. <br><br></div>It wasn't populating <b><span style="font-family:courier new,monospace">MPI_C_INCLUDE_PATH </span></b><span style="font-family:arial,helvetica,sans-serif">instead it populated</span><b><span style="font-family:courier new,monospace"> </span></b><br>

<b><span style="font-family:courier new,monospace">MPI_INCLUDE_PATH.</span></b><div class="gmail_extra"><br></div><div class="gmail_extra">So now I am using only <b><span style="font-family:courier new,monospace">MPI_INCLUDE_PATH, MPI_COMPILE_FLAGS, MPI_LINK_FLAGS and MPI_LIBRARIES </span></b><span style="font-family:arial,helvetica,sans-serif">not</span><b><span style="font-family:courier new,monospace"> MPI_C_*<br>

</span></b></div><div class="gmail_extra"><br></div><div class="gmail_extra">Thanks<br clear="all"></div><div class="gmail_extra"><div><div dir="ltr"><span style="color:rgb(0,0,0)">Bibrak Qamar</span><br style="color:rgb(0,0,0)">

<span style="color:rgb(0,0,0)"><br></span><font color="#888888"></font></div></div>
<br><br><div class="gmail_quote">On Tue, Mar 18, 2014 at 11:38 AM, Bruce Cartland <span dir="ltr"><<a href="mailto:bruce.cartland@pobox.com" target="_blank">bruce.cartland@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    By quick Google search, I meant for "cmake project command". Not
    sure how I determined this originally. It was a long time ago.
    Probably read, re-read, and re-read the doco - it wasn't obvious.
    Anyway, hope it helps.<div><div class="h5"><br>
    <br>
    <br>
    <div>On 18/03/14 17:22, Bruce Cartland
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      Try the project command<br>
      <br>
      * project(yourProjectName C)<br>
      <br>
      It's what I use.<br>
      <br>
      Quick Google found this <br>
      <br>
      * <a href="http://www.cmake.org/cmake/help/cmake2.6docs.html#command:project" target="_blank">http://www.cmake.org/cmake/help/cmake2.6docs.html#command:project</a><br>
      <br>
      <br>
      <div>On 18/03/14 17:09, Bibrak Qamar
        wrote:<br>
      </div>
      <blockquote type="cite">
        <div dir="ltr">
          <div>Hi,<br>
            <br>
          </div>
          I am using cmake to create Makefile. I am using MPI in my
          project but I only want to use the C (mpicc) not C++ (mpicxx)
          following is the CMakeLists.txt:<br>
          <div>
            <div><br>
            </div>
            <div>I have tested it but on some platforms it seems that it
              only detects the C++ mpi (mpicxx) and uses its libraries.
              This creates errors (mpi.h not found) as the project only
              needs C (mpicc and its libraries).<br>
              <br>
            </div>
            <div>So how to force cmake to only search for C (mpicc) and
              use its libraries (the mpi.h not mpicxx.h).<br>
            </div>
            <div><br>
              <span style="font-family:courier new,monospace"><br>
                <br>
                ADD_LIBRARY(nativempjdev SHARED ${SOURCE_FILES})<br>
                <br>
                find_package(MPI)<br>
                if(MPI_FOUND)<br>
                set(CMAKE_C_COMPILE_FLAGS ${CMAKE_C_COMPILE_FLAGS}
                ${MPI_C_COMPILE_FLAGS})<br>
                set(CMAKE_C_LINK_FLAGS ${CMAKE_C_LINK_FLAGS}
                ${MPI_C_LINK_FLAGS})<br>
                <br>
                include_directories(${MPI_C_INCLUDE_PATH}
                $ENV{JAVA_HOME}/include $ENV{JAVA_HOME}/include/linux)<br>
                endif(MPI_FOUND)<br>
                target_link_libraries(nativempjdev ${MPI_C_LIBRARIES})<br>
                install(TARGETS nativempjdev DESTINATION
                $ENV{MPJ_HOME}/lib)</span><br>
              <br>
              <br>
              <br>
            </div>
            <div>Thanks<br clear="all">
            </div>
            <div>
              <div>
                <div dir="ltr"> <span>Bibrak Qamar</span><br>
                  <span><br>
                  </span></div>
              </div>
            </div>
          </div>
        </div>
        <br>
        <fieldset></fieldset>
        <br>
      </blockquote>
      <br>
      <br>
      <fieldset></fieldset>
      <br>
    </blockquote>
    <br>
  </div></div></div>

<br>--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</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></blockquote></div><br></div></div>