[CMake] Using Checksum to generate files

Tyler Roscoe tyler at cryptio.net
Tue Aug 11 14:50:27 EDT 2009


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