Hi Kent.<br><br>As you say, there is no &quot;current build type&quot; in Visual Studio; that depends on what the user selects in the combo box. If you only need this information at build time, you can use the generator expression $&lt;CONFIGURATION&gt; for this purpose. See the documentation of add_custom_command(); I also believe genexes are undergoing a major overhaul for the soon-to-be 2.8.10 release.<br>
<br>If you need the information before build time (i.e. at cmake time), you&#39;re pretty much out of luck and you&#39;ll have to rework your logic somehow to push the dependency to build time.<br><br>Petr<br><br><div class="gmail_quote">
On Wed, Oct 24, 2012 at 3:57 PM, Kent Williams <span dir="ltr">&lt;<a href="mailto:nkwmailinglists@gmail.com" target="_blank">nkwmailinglists@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On platforms other than Windows, the build type is a single value<br>
stored in CMAKE_BUILD_TYPE, and can be accessed if you want your build<br>
to different things in Debug, Release, etc modes.<br>
<br>
On Windows with Visual Studio, there&#39;s a variable<br>
CMAKE_CONFIGURATION_TYPE that is a list of the builds that will be<br>
done.<br>
<br>
How do I recover the actual, current build type?<br>
<br>
The reason I need to do this: I need to import libraries built in an<br>
ExternalProject. On OS X or Linux, the libraries generated by the<br>
ExternalProject are in one predictable place.<br>
So I can do this:<br>
<br>
set(EP_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/${EP_NAME}-build/lib)<br>
<br>
On windows this will need to be<br>
<br>
# fictional variable WINDOWS_CURRENT_BUILD_TYPE giving current build type<br>
set(EP_LIB_DIR ${CMAKE_CURRENT_BINARY_DIR}/${EP_NAME}-build/${WINDOWS_CURRENT_BUILD_TYPE})<br>
<br>
Unfortunately, there&#39;s no such variable.  And, given how Visual Studio<br>
works, where you can have a build that actually builds any number of<br>
build_types at one go, I&#39;m not sure how to handle this.<br>
<br>
One thought I had was to always build the External Project as Release<br>
on Windows; then the libraries are someplace predictable.<br>
--<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>