[cmake-developers] [CMake 0014201]: FindCUDA does not forward include directories assigned by target_include_directories()

James Bigler jamesbigler at gmail.com
Wed Jun 5 12:37:08 EDT 2013


On Wed, Jun 5, 2013 at 7:45 AM, Stephen Kelly <steveire at gmail.com> wrote:

> James Bigler wrote:
>
> > Things get dicey when you want to pass things like include directories as
> > arguments.  There are quotes to deal with as well as maximum argument
> > length issues.  I'm not saying it can't be done, but it needs to be done
> > *carefully*.
>
> Yes. I just pushed a proof-of-concept for doing such necessary
> transformations, which we're not doing yet (and which are not really
> possible yet):
>
>  https://gitorious.org/~steveire/cmake/steveires-cmake/commit/66376d0
>
> Thanks,
>
> Steve.
>
>
I think you could add more and more complexity, but you won't be satisfied
until you can run arbitrary CMake code.

Here's an example of transformations I do on host flags.  I also do things
such as replace -g3 flags with -g for only certain versions of CUDA, since
I know which versions -g3 flag is broken on.

foreach(flag ${CMAKE_HOST_FLAGS} ${CMAKE_HOST_FLAGS_${build_configuration}})
  # Extra quotes are added around each flag to help nvcc parse out flags
with spaces.
  set(nvcc_host_compiler_flags "${nvcc_host_compiler_flags},\"${flag}\"")
endforeach()
if (nvcc_host_compiler_flags)
  set(nvcc_host_compiler_flags "-Xcompiler" ${nvcc_host_compiler_flags})
endif()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20130605/c9fd7d31/attachment.html>


More information about the cmake-developers mailing list