Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It depends what do you want to do. Here is 4 different solutions. There is probably others to add to this list...</p> <p><strong>install() command</strong></p> <p>If you want to copy executable and dll you just built you can use the <a href="http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:install" rel="nofollow"><code>install()</code> command</a> but it will work only when the user run <code>make install</code>.</p> <p><strong>Setting variables</strong></p> <p>If you want to do it directly at build time, you can use CMake variables to configure your build. These variables are described at <a href="http://www.cmake.org/Wiki/CMake_Useful_Variables" rel="nofollow">http://www.cmake.org/Wiki/CMake_Useful_Variables</a></p> <pre><code>EXECUTABLE_OUTPUT_PATH set this variable to specify a common place where CMake should put all executable files (instead of CMAKE_CURRENT_BINARY_DIR) SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) LIBRARY_OUTPUT_PATH set this variable to specify a common place where CMake should put all libraries (instead of CMAKE_CURRENT_BINARY_DIR) SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) </code></pre> <p><strong>A custom command</strong></p> <p>If you want to copy other executable or dll you did not build yourself (binary libs, etc.), a good solution is to use a custom command. In that case it could be very tricky to have a portable solution working on all os to copy files. That's why CMake provide this feature (with others) directly from its <code>cmake</code> executable:</p> <p>In command line you could use that:</p> <pre><code>cmake -E copy_if_different &lt;SOURCE&gt; &lt;DESTINATION&gt; </code></pre> <p>Don't forget you can call cmake executable from a CMakeLists file using <code>${CMAKE_COMMAND}</code> variable ;)</p> <p><strong>configure_file() command</strong></p> <p>And to finish, <a href="http://www.cmake.org/cmake/help/v2.8.8/cmake.html#command:configure_file" rel="nofollow">the <code>configure_file()</code>command</a> allows you to produce a file from another by replacing variables by their value in the target file. If the source file does not contains variables, the target file is only a copy of the source. But I don't know if it works perfectly with binary file. You should carefully test that by yourself.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload