On Sun, Dec 7, 2008 at 7:01 AM, Michael Jackson <span dir="ltr">&lt;<a href="mailto:mike.jackson@bluequartz.net">mike.jackson@bluequartz.net</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

There are a few variables that control where the final executables, libraries and archives are created.<br>
<br>
CMAKE_RUNTIME_OUTPUT_DIRECTORY<br>
CMAKE_LIBRARY_OUTPUT_DIRECTORY<br>
CMAKE_ARCHIVE_OUTPUT_DIRECTORY<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;• RUNTIME_OUTPUT_DIRECTORY: Output directory in which to build RUNTIME target files.<br>
This property specifies the directory into which runtime target files should be built. There are three kinds of target files that may be built: archive, library, and runtime. Executables are always treated as runtime targets. Static libraries are always treated as archive targets. Module libraries are always treated as library targets. For non-DLL platforms shared libraries are treated as library targets. For DLL platforms the DLL part of a shared library is treated as a runtime target and the corresponding import library is treated as an archive target. All Windows-based systems including Cygwin are DLL platforms. This property is initialized by the value of the variable CMAKE_RUNTIME_OUTPUT_DIRECTORY if it is set when a target is created<br>

<br>
So you can do something like:<br>
<br>
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin CACHE PATH<br>
 &nbsp;&quot;Single Directory for all executables&quot;<br>
 &nbsp;)<br>
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin CACHE PATH<br>
 &nbsp;&quot;Single Directory for all dynamic Libraries&quot;<br>
 &nbsp;)<br>
SET (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/Bin CACHE PATH<br>
 &nbsp;&quot;Single Directory for all static Libraries&quot;<br>
 &nbsp;)<br>
<br>
BEFORE any &quot;add_library&quot; or &quot;add_executable&quot; is called. That way all your built products will be created in the same directory when being built. Now, that assumes that your &quot;couple of dlls&quot; were built by your project. If they were NOT built by your project (say for example, Qt libraries) then you will want to try something a bit different.<br>

<br>
cmake -E can be used to copy files.<br>
<br>
You may want to look at the add_custom_command(TARGET ${yourExeTarget}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;POST_BUILD<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;COMMAND ${CMAKE_COMMAND} -E {path to source dll} {path to dest}<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;..... )<br>
<br>
This will probably copy the files _every_ time the target is built although I am not sure on that point.<br>
<br>
You can look up the help for add_custom_command and see if this will help you out.</blockquote></div><br>I tried the following, but it didn&#39;t print anything. Are you sure these variables even exist?<br>
<br>
message( &quot;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}&quot; )<br>
message( &quot;${CMAKE_LIBRARY_OUTPUT_DIRECTORY}&quot; )<br>
message( &quot;${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}&quot; )<br>