On Fri, Nov 4, 2016 at 2:55 PM, Brad King <[email protected]> wrote: > > On 11/03/2016 06:04 PM, John Drescher wrote: > > I opened a project in cmake-gui using the open project button from a > > vc 2010 build of a project. The open project opened the project in > > Visual Studio 2010. Later I opened the same project but a different > > build tree for Visual Studio 2013 CMake-gui had all of the correct > > information for the Visual Studio 2013 build but open project tried to > > open the Visual Studio 2013 solution in Visual Studio 2010 instead of > > the expected Visual Studio 2013.
I'm guessing you established MSVS2010 as the default application for opening .sln files the first time you used the open project button. What happens if you double click on that MSVS2013 .sln file? > The feature is new in 3.7 and was contributed here: > > cmake-gui: Add button to open the generated project > https://gitlab.kitware.com/cmake/cmake/commit/1ca2d5d1 > > I'm not particularly familiar with how it works, but from a quick > glance at the code it may be using file associations. Yes, it's just using Windows file file associations, but it shouldn't. Since it's possible (and fairly common) to have more than one version of Visual Studio installed on a system the Open Project button should be smarter and use ${CMAKE_VS_DEVENV_COMMAND} to open the .sln file. It should be something like this: MSVS2015: %VS140COMNTOOLS%..\IDE\devenv.com MSVS2013: %VS120COMNTOOLS%..\IDE\devenv.com MSVS2012: %VS110COMNTOOLS%..\IDE\devenv.com MSVS2010: %VS100COMNTOOLS%..\IDE\devenv.com If the correct devenv.exe path does not exist or can't be determined for some reason, then I guess it makes sense to fall back to using `QDesktopServices::openUrl` to try to open the .sln file with the Windows file associations. Taylor -- 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://public.kitware.com/mailman/listinfo/cmake
