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

James Bigler jbigler at nvidia.com
Thu May 8 14:43:11 EDT 2014


This is also causing my CUDA separable compilation feature to break as well.

I'm adding object files to the source list of a target, and this works in certain situations, but not all.

James

From: "jamesbigler at gmail.com<mailto:jamesbigler at gmail.com>" <jamesbigler at gmail.com<mailto:jamesbigler at gmail.com>>
Date: Thursday, May 8, 2014 12:34 PM
To: "cmake-developers at cmake.org<mailto:cmake-developers at cmake.org>" <cmake-developers at cmake.org<mailto:cmake-developers at cmake.org>>
Subject: [cmake-developers] Weird dependency on object files generated elsewhere

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<http://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

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20140508/382cc56d/attachment-0002.html>


More information about the cmake-developers mailing list