We need to find a file named "vcvarsall.bat", located in the installation directory of Visual C++, which may have one of the following path names, for example:

  "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\"
  "M:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\"
  "C:\Program Files\Microsoft Visual Studio 9.0\VC\"
  etc.

How can we retrieve this directory path name within our CMakeLists.txt? There's no standard CMake variable like ${CMAKE_COMPILER_DIR}, right?

Looking at a CMakeCache.txt file generated for Visual C++ 12 (2013) by CMake 2.8.12.2, I saw exactly one variable that would help us:

CMAKE_LINKER:FILEPATH=C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/link.exe

From there, we can easily find the path to the corresponding "vcvarsall.bat". However, ${CMAKE_LINKER} appears to be left undocumented intentionally, as it appears to be an internal variable:

  0008065: CMAKE_LINKER not mentioned on --help-variables
  http://www.cmake.org/Bug/view.php?id=8065
  Closed as "won't fix"

Does that mean we should not use ${CMAKE_LINKER}? If so, do you have another suggestion on how to find "vcvarsall.bat"?

Kind regards, Niels
--
Niels Dekker
Scientific programmer
LKEB, Leiden University Medical Center


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to