<div dir="ltr"><div><div>Hi Niels.<br><br></div>I can't comment on the "useful variable" list, but I'd just like to point out that the variable is not undocumented. It's listed normally in the "variables for languages" section (<a href="http://www.cmake.org/cmake/help/v3.2/manual/cmake-variables.7.html#variables-for-languages">http://www.cmake.org/cmake/help/v3.2/manual/cmake-variables.7.html#variables-for-languages</a>) of the documentation as CMAKE_<LANG>_COMPILER_VERSION; that's because it can be set for all enabled languages, not just CXX.<br><br><a href="http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_COMPILER_VERSION.html">http://www.cmake.org/cmake/help/v3.2/variable/CMAKE_LANG_COMPILER_VERSION.html</a><br><br></div>Petr<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 14, 2015 at 6:18 PM, Niels Dekker - address until 2018 <span dir="ltr"><<a href="mailto:niels_dekker_address_until_2018@xs4all.nl" target="_blank">niels_dekker_address_until_2018@xs4all.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">When CMake (current version: 3.2.2) generates project files for Visual Studio, it appears to define an undocumented variable that seems quite useful to me: CMAKE_CXX_COMPILER_VERSION. It appears to be the full compiler version. For example, for my VS2010 installation, CMAKE_CXX_COMPILER_VERSION is "16.0.40219.1", and for my VS2013 installation, CMAKE_CXX_COMPILER_VERSION is "18.0.31101.0".<br>
<br>
It seems useful to me to pass this CMake variable to the resource compiler, which does not have direct access to the macro's predefined by the C++ compiler (like _MSC_FULL_VER and _MSC_BUILD), for example by adding a "-D" flag:<br>
<br>
add_definitions(-DMY_COMPILER_VERSION="${CMAKE_CXX_COMPILER_VERSION}")<br>
<br>
Do you agree that it would be a good idea to add CMAKE_CXX_COMPILER_VERSION to the list of useful CMake variables, at <a href="http://www.cmake.org/Wiki/CMake_Useful_Variables" target="_blank">http://www.cmake.org/Wiki/CMake_Useful_Variables</a> ?<br>
<br>
<br>
Kind regards, Niels<br>
-- <br>
Niels Dekker<br>
Scientific programmer at LKEB<br>
Leiden University Medical Center<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</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>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake" target="_blank">http://public.kitware.com/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>