[CMake] SPECIFYING THE DEPENDENCY BETWEEN NON-C FILES

David Cole david.cole at kitware.com
Wed Sep 28 08:24:09 EDT 2005


See also:
http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_the_build.3F

Read the section in its entirety (if not the entire FAQ...)

The very bottom of the section "How can I generate a source file during 
the build?" talks about what's necessary to generate a header and obtain 
proper dependencies.


David


Dekeyser, Kris wrote:

>Hi,
>
>You should:
>
>ADD_CUSTOM_COMMAND(OUTPUT H-a.h COMMAND "T" ARGS F-a.txt H-a.h DEPENDS F-a.txt)
>SET_SOURCE_FILES_PROPERTIES(H-a.h PROPERTIES GENERATED TRUE)
>
>And probably also:
>
>SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES H-a.h)
>
>HTH, Kris
>
>-----Original Message-----
>From: Oh K [mailto:dmbmate at gmail.com] 
>Sent: Wednesday, 28 September, 2005 11:09
>To: cmake at cmake.org
>Subject: [CMake] SPECIFYING THE DEPENDENCY BETWEEN NON-C FILES
>
>Hello,
>
>I wonder if someone can help me with specifying the dependency rules
>between inexistent files.
>
>The situation is as follows: A header file named 'H-a.h', is supposed
>to be created by an extenal tool named T using the other file named
>'F-a.txt' during the build process.  Of course, there is a c file
>named 'C-a.c' dependant to 'H-a.h'.  I know there is a dependency
>between 'H-a.h' and 'F-a.txt', while there is no such file, 'H-a.h'
>before the beginning of a build.  I tried SET_SOURCE_FILES_PROPERTIES
>like SET_SOURCE_FILES_PROPERTIES(H-a.h PROPERTIES OBJECT_DEPENDS
>F-a.txt)'.  However, I continue to fail to generate a dependency rule
>between these 2 files.  I think it does not work because the H-a.h is
>not an object file.
>
>I wonder if there is some proper ways to create the dependency rule
>between non-C files.
>
>K Oh
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
>+-+-+- Email Confidentiality Footer +-+-+- 
>Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not print, retain, copy nor disseminate this message or any part of it to anyone and you should notify the sender by reply email and destroy this message. Neglecting this clause could be a breach of confidence. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. Opinions, conclusions and other information in this message that are not related to the official business of my firm shall be understood as neither given nor endorsed by it.
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
>
>
>  
>



More information about the CMake mailing list