Visual Studio: force use of folders

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Visual Studio: force use of folders

Alexander Hans
Hi all,

we have the following setup: Visual Studio 2013 Professional is installed,
but for compatibility reasons we need to use the Visual Studio 2010
(vc100) compilers. To that end we have Visual Studio 2010 Express
installed (to complicate things, we also need the Windows SDK 7.1 to get
access to compilers that can produce 64-bit code). What we want is to use
Visual Studio 2013 as IDE with the vc100 compilers. It is possible to
create a Visual Studio 2010 solution with CMake and open and compile that
with Visual Studio 2013. However, as CMake detects an Express Edition of
the target platform, it disables generation of folders in the solution.
However, folder support is one of the main reasons to use Visual Studio
2013 Professional instead of the 2010 Express Edition. Is there a way to
force folder generation in that case? Looking at the source code of the
corresponding generator, I don't see a way. By removing the check for
IsExpressEdition() in cmGlobalVisualStudio8Generator::UseFolderProperty()
and simply always returning cmGlobalGenerator::UseFolderProperty(),
folders are generated also if an Express edition is detected. Obviously,
that's not a nice solution, since now when actually using an Express
Edition, many warnings need to be clicked away ...

If this cannot be solved with some already existing option, I would like
to implement the option to force folder generation. What would be the
preferred way to do this? What comes to mind is implementing a new
generator that inherits everything from the existing one and only
overrides UseFolderProperty() method, or implementing an option for the
existing one. How would one implement such an option? As additional
space-separated parameter like the platform (e.g., Visual Studio 2010
Win64 force_folders)?


Thanks!

Alex

--

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Visual Studio: force use of folders

Brad King
On 01/31/2017 05:17 AM, Alexander Hans wrote:
> What we want is to use Visual Studio 2013 as IDE with the vc100 compilers.
> It is possible to create a Visual Studio 2010 solution with CMake and open
> and compile that with Visual Studio 2013.

Instead you should use the "Visual Studio 12 2013" generator but specify
the `vc100` toolset:

  cmake ../src -G "Visual Studio 12 2013" -T vc100

There is also an option in cmake-gui to do this on initial configuration
of a new build tree.  See also these docs:

  https://cmake.org/cmake/help/v3.7/variable/CMAKE_GENERATOR_TOOLSET.html

This way you get native generation for the VS 2013 IDE but the project
will use the `vc100` tools when built.

-Brad

--

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
Loading...