CMake autodetect Visual Studio directory on windows -
currently, in order create static libs on windows, manually have specify visual studio directory is.
cmake -g "mingw makefiles" -dcmake_c_compiler=gcc -dcmake_gnutoms=1 -dcmake_gnutoms_vcvars="c:\program files (x86)\microsoft visual studio 14.0\vc\vcvarsall.bat" ..
is there way cmake automatically query location of visual studio? windows-gnu.cmake
module seems able query registry location of lib.exe
executable, still forces user manually specify it's location. excerpt cmake:
find_program(cmake_gnutoms_vcvars names vcvars32.bat doc "visual studio vcvars32.bat" paths "[hkey_local_machine\\software\\microsoft\\visualstudio\\12.0\\setup\\vc;productdir]/bin" #d "[hkey_local_machine\\software\\microsoft\\visualstudio\\11.0\\setup\\vc;productdir]/bin" "[hkey_local_machine\\software\\microsoft\\visualstudio\\10.0\\setup\\vc;productdir]/bin" "[hkey_local_machine\\software\\microsoft\\visualstudio\\9.0\\setup\\vc;productdir]/bin" "[hkey_local_machine\\software\\microsoft\\visualstudio\\8.0\\setup\\vc;productdir]/bin" "[hkey_local_machine\\software\\microsoft\\visualstudio\\7.1\\setup\\vc;productdir]/bin" "[hkey_local_machine\\software\\microsoft\\visualstudio\\6.0\\setup\\microsoft visual c++;productdir]/bin" )
the above cmake 3.6.0.
if building static library primary concern, have tried setting
-dbuild_shared_libs=off
or similar (e.g. add_library
static
) force static build?
Comments
Post a Comment