Re: [CMake] CUDA: COMPILE_DEFINITIONS not picked up

2016-08-30 Thread Peter Steinbach
Karl, good question. The docs say that you supply OPTIONS to cuda_add_library, which are in turn handed over to cuda_wrap_srcs. the only chance I see is digging there. internally, both cuda_add_xxx create regular cmake targets. I am not sure why cmake doesn't accept subsequent

Re: [CMake] CUDA: COMPILE_DEFINITIONS not picked up

2016-08-30 Thread Karl Ljungkvist
Peter, I use CMake 3.5.1 and 3.0.2, and this works the same with both. Thanks for your suggestions. It does indeed work if I define them explicitly like that, but the reason why I want to use something like COMPILE_DEFINITIONS is that we have a large library that has several targets with

Re: [CMake] CUDA: COMPILE_DEFINITIONS not picked up

2016-08-26 Thread Peter Steinbach
Hey Karl, just gave it another shot ... so I can confirm what you saw with cmake 3.3 (btw, what cmake version did you use?). I should try a more recent one to make sure as well. anyhow, there 2 global workarounds that you have at your disposal: 1) set(CUDA_NVCC_FLAGS "-Dfoo") needs to be

Re: [CMake] CUDA: COMPILE_DEFINITIONS not picked up

2016-08-26 Thread Peter Steinbach
Hi Karl, just a quick question, why not use add_definitions? Did you look into it or is directory-wide preprocessor defines a nogo in your use case? Best, Peter -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

[CMake] CUDA: COMPILE_DEFINITIONS not picked up

2016-08-25 Thread Karl Ljungkvist
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,