<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thanks for your directions, I'm experiencing one problem however:<br>
<br>
I can't seem to communicate a variable from my project configure (which
contains the ADD_CUSTOM_COMMAND) to the invocation of myscript.cmake.<br>
<br>
The command below is:<br>
<pre wrap="">COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/myscript.cmake</pre>
I expected that I could used -D to pass a variable from the command
like to the script:<br>
<pre wrap="">COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/myscript.cmake -D MYVAR:STRING=FOO

</pre>
But that didn't work.<br>
<br>
Any advice? It would be nice if myscript.cmake could use the same cache
as the project configure too.<br>
<br>
<br>
Thanks--<br>
<br>
Abe<br>
<br>
Brad King wrote:
<blockquote cite="mid44C61C0C.5080508@kitware.com" type="cite">
  <pre wrap="">Abe Stephens wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">How can I have a CMake script run if a certain non-source file has
changed since the last project build?

I have a script which extracts some revision information from "svn info"
and places it in a source file via CONFIGURE_FILE. I'd like this script
to be executed during build every time the
${CMAKE_SOURCE_DIR}/.svn/entries file changes.  (This file is altered
every time I commit a file or update from the repository.)
    </pre>
  </blockquote>
  <pre wrap=""><!---->
# Configure the script to know where to put the output file.
# It should reference @MYSCRIPT_OUTPUT@ to get this variable setting.
SET(MYSCRIPT_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/myoutput.txt)
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/myscript.cmake.in
               ${CMAKE_CURRENT_BINARY_DIR}/myscript.cmake)

# Add a custom command to drive the script whenever the svn entries
# file changes.
ADD_CUSTOM_COMMAND(
  OUTPUT ${MYSCRIPT_OUTPUT}
  DEPENDS ${CMAKE_SOURCE_DIR}/.svn/entries
  COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/myscript.cmake
  )

# Add a custom target to drive the custom command.
ADD_CUSTOM_TARGET(svn_check ALL DEPENDS ${MYSCRIPT_OUTPUT})

-Brad
  </pre>
</blockquote>
<br>
</body>
</html>