Hi

I'm using CMake to build my CUDA projects and I would like to add some
options specifically for CUDA targets. For example to define a macro
(-D when using gcc or nvcc) So I tried the following:

cuda_add_executable(SimpleTestsCUDA
                    SimpleTests.cu
                    BlockMatrix.cpp
                    Matrix.cpp
)

set_target_properties(SimpleTestsCUDA PROPERTIES COMPILE_FLAGS -DBLOCK_SIZE=3)

After running make VERBOSE=1 I saw that nvcc is invoked w/o the macro
defined above. (-DBLOCK_SIZE=3) The same thing worked for a CPU target
with add_executable.

Somebody also recommended me to try:

cuda_add_executable(SimpleTestsCUDA
                SimpleTests.cu
                BlockMatrix.cpp
                Matrix.cpp
                OPTIONS -DBLOCK_SIZE=3
)

Which didn't work either.

I've tested this on my Mac (OSX 10.6) with CMake 2.8.1 and CUDA 3.0.

Nils
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to