<div dir="ltr"><div>It works perfectly - thanks!</div><div><br></div><div>QT<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, 28 Aug 2018 at 12:37, Robert Maynard <<a href="mailto:robert.maynard@kitware.com">robert.maynard@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The way Eric suggest with check_language is what I use when I want to conditionally support CUDA.</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 28, 2018 at 10:28 AM Eric Noulard <<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">Le mar. 28 août 2018 à 19:07, Quang Ha <<a href="mailto:quang.t.ha.20@gmail.com" target="_blank">quang.t.ha.20@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,</div><div><br></div><div>So this question is again about project(foo LANGUAGES CXX CUDA). Is it possible to switch off CUDA if Cmake couldn't find CUDA compiler? I.e. something along the line:</div></div></blockquote><div><br></div><div>May be you can only:</div><div><br></div><div>  project(foo LANGUAGES CXX)</div><div><br></div><div>then</div><div><br></div><div>include(CheckLanguage)</div><div><div>check_language(CUDA)</div><div>if(CMAKE_CUDA_COMPILER)</div><div>  enable_language(CUDA)</div><div>else()</div><div>  message(STATUS "No CUDA compiler found")</div><div>endif()</div></div><div><br></div><div>see doc:</div><div><a href="https://cmake.org/cmake/help/latest/module/CheckLanguage.html" target="_blank">https://cmake.org/cmake/help/latest/module/CheckLanguage.html</a><br></div><div><br></div><div><br></div><div>Eric</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>if (CUDA_FOUND)</div><div>  set_language_to_CUDA_and_CXX</div><div>else(CUDA_FOUND)</div><div>  set_language_to_CXX_only</div><div>endif(CUDA_FOUND)</div><div><br></div><div>The main reason is I don't want CMake to fail when CUDA compiler isn't available. Rather, it should continue to compile the source files using CPP compilers instead.</div><div><br></div><div>Thanks,</div><div>Quang<br></div></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_1070938148510323717m_4313575647101384174gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Eric<br></div></div></div></div></div></div>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" 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" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>
</blockquote></div>