<div dir="ltr">Yes, the official FindBoost works better xD<div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Dec 25, 2015 at 8:40 PM Nils Gladitz <<a href="mailto:nilsgladitz@gmail.com">nilsgladitz@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 25.12.2015 10:36, Xi Shen wrote:<br>
> Hi,<br>
><br>
> I know I can check MSVC to determine if the Visual Studio generator is<br>
> used. But how do I find out which version is been used?<br>
<br>
MSVC indicates that the Visual C++ compiler (or something compatible) is<br>
being used; which does not necessarily mean a Visual Studio generator.<br>
If you do need to make that distinction you can check MSVC_IDE [1] instead.<br>
<br>
><br>
> The reason I want to find the the version of VS being used, is because<br>
> I need to link to the Boost libraries. Boost create its libraries with<br>
> suffixes like "-vs120-mt", etc. and "vs120" indicates Visual Studio 2013.<br>
<br>
Why aren't you using the Boost find module[2] included with CMake? It<br>
already accounts for Boost's library name mangling.<br>
<br>
The module uses e.g. the MSVC12 [3] variable to detect "vc120".<br>
But I am guessing CMAKE_<LANG>_COMPILER_VERSION [4] might work for this<br>
use case nowadays as well.<br>
<br>
Nils<br>
<br>
[1] <a href="https://cmake.org/cmake/help/v3.4/variable/MSVC_IDE.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.4/variable/MSVC_IDE.html</a><br>
[2] <a href="https://cmake.org/cmake/help/v3.4/module/FindBoost.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.4/module/FindBoost.html</a><br>
[3] <a href="https://cmake.org/cmake/help/v3.4/variable/MSVC12.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.4/variable/MSVC12.html</a><br>
[4]<br>
<a href="https://cmake.org/cmake/help/v3.4/variable/CMAKE_LANG_COMPILER_VERSION.html" rel="noreferrer" target="_blank">https://cmake.org/cmake/help/v3.4/variable/CMAKE_LANG_COMPILER_VERSION.html</a><br>
</blockquote></div><div dir="ltr">-- <br></div><div dir="ltr"><p dir="ltr">Regards,<br>
David</p>
</div>