Using variables within cmake-gui
<p>I am using cmake-gui to create a Visual Studio Solution. My directory structure looks something like this:</p>

<pre><code>Foo
|-- source
|-- include
|-- docs
|-- // ...
|-- bin   // desired output directory
|-- build // cmake build directory
</code></pre>

<p>I want to set the output directory for the generated projects to be located at the following location: <code>Foo/bin</code>.</p>

<p>If I understand correctly, the cmake variable <a href="https://cmake.org/cmake/help/v3.4/variable/PROJECT_SOURCE_DIR.html" rel="nofollow">PROJECT_SOURCE_DIR</a> contains the absolute path to the "Foo" directory shown in the directory diagram above. Using cmake-gui, I'm trying to set <code>CMAKE_ARCHIVE_OUTPUT_DIRECTORY</code>to the value of <code>${PROJECT_SOURCE_DIR}/bin/static/$(Platform)/$(Configuration)</code></p>

<p>Where <code>$(Platform)</code> and <code>$(Configuration)</code> are Visual Studio macros.</p>

<p>This does not produce the expected result. The problem is that CMake does not substitute "${PROJECT_SOURCE_DIR}" with its value, meaning in the generated .vcxproj the output directory value is literally: "${PROJECT_SOURCE_DIR}/bin/static/$(Platform)/$(Configuration)"</p>

<p>Simply put, my question is: How can CMake variables be used in cmake-gui?</p>