You need to add ${ptxfiles} to your add_executable command, so that it contains both the source and generated files.<br><br>For makefile targets you need to establish a dependency between the target (cuda_core_test) and your ptx files.  This is done by putting the generated files into the target.  For VS it is backward, and you generally only need to add the source files to the project (provided there is a MAIN_DEPENDENCY set on the file - which it is for FindCUDA by default).<br>

<br>James<br><br><div class="gmail_quote">On Wed, Feb 17, 2010 at 12:37 PM, Denis Taniguchi <span dir="ltr">&lt;<a href="mailto:taniguchi@tpn.usp.br">taniguchi@tpn.usp.br</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi all,<br>
<br>
I was trying to use CUDA_COMPILE_PTX to make nvcc compile *.cu files<br>
to .ptx files but with no success.<br>
Running make just compile my regular .cpp files and does nothing to .cu<br>
files. I want the ptx files to use them with CUDA driver API.<br>
I checked in the trunk SVN repository of FindCUDA but the line for<br>
CUDA_COMPILE_PTX was commented out in the example.<br>
Regards,<br>
<br>
Denis<br>
<br>
#####################################################################<br>
<br>
# habilitar o módulo FindBoost<br>
find_package (Boost 1.42.0 COMPONENTS thread)<br>
# habilitar o módulo FindCUDA<br>
find_package (CUDA)<br>
<br>
file (GLOB_RECURSE sources *.cpp)<br>
file (GLOB_RECURSE cufiles *.cu)<br>
cuda_compile_ptx (ptxfiles cufiles)<br>
add_executable (cuda_core_test ${sources})<br>
<br>
# para poder usar variadic template parameters<br>
set_target_properties (cuda_core_test PROPERTIES COMPILE_FLAGS -std=c<br>
++0x)<br>
# gcc version &lt; 4.4 não possuem o header initilizer_list<br>
add_definitions (-DBOOST_NO_0X_HDR_INITIALIZER_LIST)<br>
<br>
include_directories (${CUDA_TOOLKIT_INCLUDE})<br>
target_link_libraries (cuda_core_test ${CUDA_CUDA_LIBRARY}<br>
${Boost_LIBRARIES})<br>
<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 <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: <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></blockquote></div><br>