[CMake] CUDA: COMPILE_DEFINITIONS not picked up

Karl Ljungkvist karl.ljungkvist at it.uu.se
Thu Aug 25 08:35:56 EDT 2016


Hi all,

if I do something like this,


ADD_EXECUTABLE(myprog myprog.cpp)

SET_PROPERTY(TARGET myprog APPEND PROPERTY
  COMPILE_DEFINITIONS "DEF1;DEF2"
  )


then the two macros DEF1 and DEF2 will be defined at compilation.
However, if I switch to the corresponding CUDA setup,


CUDA_ADD_EXECUTABLE(myprog myprog.cu)

SET_PROPERTY(TARGET myprog APPEND PROPERTY
  COMPILE_DEFINITIONS "DEF1;DEF2"
  )

then they are not defined. Is this the intended behavior, and if so, how
can I make the cuda version pick up the COMPILE_DEFINITIONS

Best regards,
Karl

-- 
Karl Ljungkvist
PhD student

Uppsala University
Dept. of Information Technology
Div. of Scientific Computing
Box 337
SE-751 05 Uppsala, Sweden
Email: karl.ljungkvist at it.uu.se
Phone:  +46 18 471 2967
Mobile: +46 70 200356



More information about the CMake mailing list