|
Notes |
|
|
(0027005)
|
|
Brad King
|
|
2011-07-04 09:03
|
|
As a sanity check on the steps to reproduce, you wrote:
CUDA_ADD_LIBRARY(mycudalib SHARED file.cu)
SET_TARGET_PROPERTIES(mylib DEFINE_SYMBOL CUSTOM_DEFINE_SYMBOL)
but the target names do not match: "mycudalib" v. "mylib". I assume you meant them to match? |
|
|
|
(0027006)
|
|
Mourad
|
|
2011-07-04 10:04
|
|
Yes you are right, the target names are meant to match.
CUDA_ADD_LIBRARY(mycudalib SHARED file.cu)
SET_TARGET_PROPERTIES(mycudalib DEFINE_SYMBOL CUSTOM_DEFINE_SYMBOL) |
|
|
|
(0027009)
|
|
James Bigler
|
|
2011-07-05 12:25
|
|
This will never work with the current implementation.
1. FindCUDA doesn't support setting properties after calls to CUDA_ADD_*, because all the build commands are generated at the call site (configure time) of CUDA_ADD_* and not later (generation time).
2. As far as I know target properties can't be added on targets that don't exist yet, so this turns into a chicken and egg problem. If CMake supported generate time configure files, this might be able to be supported.
I would suggest you set the define as a flag.
CUDA_ADD_LIBRARY(mylib SHARED file.cu OPTIONS -DCUSTOM_DEFINE_SYMBOL)
Please let me know if this work around won't work for you. |
|
|
|
(0027014)
|
|
Mourad
|
|
2011-07-06 15:32
|
|
|
Thanks for looking into this. Yes the work around you suggested does work for me. |
|
|
|
(0027015)
|
|
James Bigler
|
|
2011-07-06 16:08
|
|
|
Thanks for replying Mourad. |
|