[CMake] Creating one Visual Studio solution for many configurations and platforms

Philip Lowman philip at yhbt.com
Fri Jun 5 22:17:43 EDT 2009


On Fri, Jun 5, 2009 at 1:13 PM, David Cole <david.cole at kitware.com> wrote:

> You might want to open an issue that is a feature request that asks for
> exactly what you think you want....
> There are several already open that talk about / have patches for adding
> support for WinCE and Symbian via adding CMake generators.
>
> At least these 3 (and probably more) already touch on the topic:
> http://public.kitware.com/Bug/view.php?id=8486
> http://public.kitware.com/Bug/view.php?id=8102
> http://public.kitware.com/Bug/view.php?id=7919
>
> Unfortunately, some of these take the approach of adding more and more
> CMake generators rather than simply using the existing generators and adding
> platforms. Granted, there are several things to consider in a re-design that
> would allow extending to platform-organized sln/vcproj files... but I think
> it would be better in the long run than simply adding new CMake generators
> every time somebody wants a new architecture in a Visual Studio project.
>
> The main issue is TRY_COMPILE results. They will be different for different
> architectures. Of course, strictly speaking, you could construct try_compile
> calls that give you one result in a Debug build and another in a Release
> build, right now. (Different build time configs may results in different
> results...) So.... really try_compile needs to be avoided or somehow account
> for different configs and platforms for a project to work as expected after
> being configured by CMake. (Iterating over all generated configs/platforms
> and storing separate results keyed by config and platform would be one
> approach...)
>
> Looking forward to more discussion.....
>

How would you handle target_link_libraries() and, ultimately,
find_library()?  Most people using VS that would want this feature added
probably already have many of their dependencies setup with find_package()
and/or find_library().

I guess I'm not a big fan of this idea, not because I don't think it might
be beneficial, but just because it goes against the CMake design which has
always been "one compiler at a time" and I think would be hard and/or hacky
to implement.

Instead, how about retrofitting CMake gui with tabs each of which is a build
configuration/build directory.  The user could choose which generators he
wants on initial configure via dialog box (similar to how it is now) but
click a big "configure all" button which kicks off n threads and runs
configure on all of the tabs creating multiple build directories for each
configuration.  If there are any issues, he could dive into each individual
build configuration and modify things.  The "generate all" button wouldn't
work until all build trees have no more modified variables.

For VS, you would still have to open up your IDE twice (or switch solution
files) but at least you could configure both builds simultaneously in the
same application.  Also some IDEs like Eclipse would allow you to have each
solution file open in the same window so you could build them
simultaneously.

This feature, if implemented would also be a great help for the Makefile
generator.

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090605/b7fc72ea/attachment.htm>


More information about the CMake mailing list