Charlie,<br><br>Move all your input data files to the resource folder and add following to the end of CMakeLists.txt<br><br><span style="font-family: courier new,monospace;">######################################</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"># Post-build steps</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">######################################</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">add_custom_command(</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> TARGET ${PROJECT_NAME}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;"> POST_BUILD</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> COMMAND ${CMAKE_COMMAND} ARGS -E copy_directory ${${PROJECT_NAME}_SOURCE_DIR}/resources ${${PROJECT_NAME}_BINARY_DIR}</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">)</span><br style="font-family: courier new,monospace;"><br><span style="font-family: courier new,monospace;">PROJECT_NAME<span style="font-family: arial,helvetica,sans-serif;"> is a variable </span></span>that holds name of the target.<br>
<br>After all your executale files will work correctly from VS and on Linux.<br><br>BTW, how about to add to CMake posibility to create symbolic/hard links?<br><br><div class="gmail_quote">2009/6/19 Charlie Sun <span dir="ltr"><<a href="mailto:charliejjs@gmail.com">charliejjs@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Because I would need to run the test using ctest, and the test cases
have hard-coded and relative paths configured. If i do an out-of-source
build. Some test cases would fail. <br>I am also building the project
on windows Visual studio, which does not have the problem with
in-the-source. it will put object files in different folders
(release/debug).<br>
Therefore, I don't know why it won't work in that way on Linux.<br><br>Thanks and regards,<br><font color="#888888"><font color="#888888"><br>Charlie </font><br></font><div><div></div><div class="h5"><br><div class="gmail_quote">
On Wed, Jun 17, 2009 at 11:39 AM, Bill Hoffman <span dir="ltr"><<a href="mailto:bill.hoffman@kitware.com" target="_blank">bill.hoffman@kitware.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><div></div><div>Charlie Sun wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
I'm trying to do a linux build with both release and debug mode. In stead of builing out of source as indicated on the FAQ 4.15, I really need to do in the source build. currently, if I do a release build and then a debug build and then another release build. It will actually rebuild the release and forgets the previous release build. Is it because cmake is only generating one set of objective files when doing in-the-source, either release or debug? Is there a way to have both? Any help is greatly appreciated!<br>
<br>
Regards,<br>
</blockquote>
<br></div></div>
The only way to do what you want is to use out of source builds. Why do you have to do in-source builds?<br><font color="#888888">
<br>
-Bill<br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br>