[CMake] Using Checksum to generate files

avner cohen avcoh at yahoo.com
Wed Aug 12 01:11:35 EDT 2009


Thanks Tyler.

I'm not sure I'm following how this is related to my question.

The solution I'm looking for is to be able to execute or generate a file, ONLY when an out-of-project file is being modified (which is why I tried to use checksum caching). How is this condition satisifed in the below link?

Regards,
       Avner.



----- Original Message ----
From: Tyler Roscoe <tyler at cryptio.net>
To: avner cohen <avcoh at yahoo.com>
Cc: Eric Noulard <eric.noulard at gmail.com>; cmake at cmake.org
Sent: Tuesday, August 11, 2009 9:50:27 PM
Subject: Re: [CMake] Using Checksum to generate files

On Tue, Aug 11, 2009 at 11:28:14AM -0700, avner cohen wrote:
> But now, I need to take this a step further and add a custom rule so
> that I make sure that the above logic is execute on each and every
> build (i.e. reminder - the trigger to generate the IDL is IDL change
> and not CMakeLists.txt change).  It than that the "-P" comes into
> play, and I can try and do (where above logic is inside
>  IDL_COMPILE.cmake):

> ADD_CUSTOM_TARGET(IDL_4 ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/IDL_COMPILE.cmake SOURCES "${PROJECT_SOURCE_DIR}/IDL_COMPILE.cmake")
> ADD_DEPENDENCIES(${PROJECT_NAME} IDL_4)

Have you read and understood this?

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

That pattern should get you what you want.

tyler



      


More information about the CMake mailing list