<div dir="ltr">Use add_custom_command to compile your files. This one accepts source and destination file names for proper dependency handling.<br>Next, use add_custom_target command with dependencies on add_custom_target's output.<br>
For example:<br>add_custom_command(OUTPUT myscript.compiled<br> COMMAND compile_script myscript.src<br> DEPENDS myscript.src)<br>add_custom_target(BuildScripts DEPENDS myscript.compiled VERBATIM)<br><br>Something like this. See documentation for both commands. Of course, you can use single custom target for all your scripts, and you can write macro to wrap script's sources with add_custom_command.<br>
<br><br><div class="gmail_quote">On Tue, Sep 23, 2008 at 1:43 AM, Jesse Corrington <span dir="ltr"><<a href="mailto:jesse.corrington@gmail.com">jesse.corrington@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">I'm trying to create a custom target for compiling scripts in MSVC, but I can't seem to find anyway to add the files to the project when using ADD_CUSTOM_TARGET. I just want to be able to add files to a custom target project and then specify a post build step to compile the scripts with our internal script compiler. The current hack I have in place is to use ADD_EXECUTABLE and just use a dummy cpp file with an empty main. I figure there must be a better way than this.</div>
<br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>