[cmake-developers] Weird dependency on object files generated elsewhere

James Bigler jamesbigler at gmail.com
Thu May 8 14:34:22 EDT 2014


I was planning on fixing a bug related to flags and separable compilation
for FindCUDA when I discovered something peculiar.  I'm asking here in case
I missed something with how source files are processed.

I branched off of origin/master this morning.

I have a macro that generates some custom commands for building object
files for cuda (found in FindCUDA.cmake).

CUDA_COMPILE(CUDA_FILES test_bin.cu)
message("CUDA_FILES = ${CUDA_FILES}")

ADD_EXECUTABLE(cuda_compile_example
  ${CUDA_FILES}
  ${source_files}
  main.cc
  external_dependency.h
  )

When print out CUDA_FILES I get a full path:

CUDA_FILES =
/Users/jbigler/code/FindCUDA/build-cmake-git/src/CMakeFiles/cuda_compile.dir//./cuda_compile_generated_test_bin.cu.o

Great!

When I try to compile cuda_compile_example I get this, though:

make[2]: *** No rule to make target
`src/CMakeFiles/cuda_compile.dir/cuda_compile_generated_test_bin.cu.o',
needed by `src/cuda_compile_example'.  Stop.

What I don't see in my makefiles is the build rule for the object file.

I can provide a reproducer, but it would require having CUDA installed.

This is for OSX 10.8 with Xcode 5.1 (command line utils, so Makefile).

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140508/ac53b091/attachment.html>


More information about the cmake-developers mailing list