Hello,

I have a question concerning the order in that transitiv dependencies
are resolved.

My target depends on a source file. This source file is generated by
an external tool by ADD_CUSTOM_COMMAND.
To to ensure the file is always up to date I used ADD_CUSTOM_COMMAND
with a phony target.

Example:

# generate source file
add_custom_command( OUTPUT __phony_target_name
     COMMAND some_command_to_generate
     ARGS -o __my_outfile.cpp
     ....
)

set_source_files_properties( __phony_target_name PROPERTIES SYMBOLIC TRUE )     

set_source_files_properties( __my_outfile.cpp PROPERTIES GENERATED TRUE )

set_source_files_properties( __my_outfile.cpp PROPERTIES
OBJECT_DEPENDS ${__phony_target} )

add_executable( __my_target  __my_outfile.cpp  )



The problem is that it needs 2 compile runs to bring __my_outfile.cpp
up to date. In the first pass the file is generated but not compiled.
In the second run it gets compiled. As far as I understand the
dependencies I created are transitve and should work in a single
compile run.

target --> depends on
__my_outfile.obj --> depends on
__my_outfile.cpp --> depends on
__phony_target_name

Any idea why it isn't working?

regards
_______________________________________________
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