<div dir="ltr">I have been playing around with this, and can't seem to figure it out. My project gets created, but it doesn't compile the script and in visual studio the script is not listed under the project in the solution explorer. There is a .rule file, which almost points to my script, but has a strange path. It's path ends up as CMAKE_SOURCE_PATH/full path to script/.rule, which is bad because it has c:\ in it twice. Any ideas what I'm doing wrong. If done correctly, will I be able to see the scripts listed in visual studio for editing inside the IDE? Below is my source. Thanks<div>
<br></div><div><div>ADD_CUSTOM_COMMAND( </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>OUTPUT "\"${binDirNative}\\main.js.bin\""</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>COMMAND ${COMPILE_SCRIPT} "-o \"${binDirNative}\\main.js.bin\""</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>DEPENDS "\"${binDirNative}\\main.js\"" )</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span></div><div>ADD_CUSTOM_TARGET(</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>Test DEPENDS "\"${binDirNative}\\mo\\main.sjs.bin\"" VERBATIM )</div><br><div class="gmail_quote">On Wed, Sep 24, 2008 at 7:48 AM, Timenkov Yuri <span dir="ltr"><<a href="mailto:ytimenkov@gmail.com">ytimenkov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><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"><div class="Ih2E3d">On Tue, Sep 23, 2008 at 1:43 AM, Jesse Corrington <span dir="ltr"><<a href="mailto:jesse.corrington@gmail.com" target="_blank">jesse.corrington@gmail.com</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex"><div class="Ih2E3d">
<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></div>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">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>
</blockquote></div><br></div></div>