> If you hide it behind a function-like macro then you can use
> the IMPLICIT_DEPENDS_INCLUDE_TRANSFORM to tell the targets
> where you want the dependency how to get it:

Thanks, that worked.  Here's what I had to do, maybe there was an
easier way I missed.

1. Define macros MY_ADD_LIBRARY and MY_ADD_EXECUTABLE like this:

macro (MY_ADD_EXECUTABLE target)
  add_executable(
    ${target}
    ${ARGN}
  )
  set_target_properties(
    ${target} PROPERTIES
    IMPLICIT_DEPENDS_INCLUDE_TRANSFORM "MY_CMAKE_DEPENDENCY_HACK(%)=\"%\""
  )
endmacro (MY_ADD_EXECUTABLE)

2. Replace all ADD_LIBRARY and ADD_EXECUTABLE calls with
MY_ADD_LIBRARY and MY_ADD_EXECUTABLE, **except** for the code
generator executable.

3. Create a wrapper header GeneratedFile_WRAPPER.h that looks like this:

#define MY_CMAKE_DEPENDENCY_HACK(a) #a
#include MY_CMAKE_DEPENDENCY_HACK(GeneratedFile.h)
#undef MY_CMAKE_DEPENDENCY_HACK

4. Change around 20 files to include the wrapper instead of the GeneratedFile.h

Thanks again for the help Brad!
-dan
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to