On Do, 2016-06-30 at 15:00 -0400, Brad King wrote:
> On 06/30/2016 09:51 AM, Tobias Hunger wrote:
> > Compared to the bug report mentioned above the fields "multiconfig" and
> > "recursive" are missing. I could not figure out how to get that
> > information:-/
> 
> There is no "recursive" generator, so that does not belong in the example
> anyway.  The Makefile generator does not produce recursive makefiles:
> 
>  https://cmake.org/Wiki/CMake_FAQ#Why_does_CMake_generate_recursive_Makefiles.
> 3F

Great, one thing less to worry about:-)

> For "multiconfig", there is the cmGlobalGenerator::IsMultiConfig method.
> Something similar will have to be added to the generator factory APIs
> so that we can ask for this information without creating a generator.

Sorry for not knowing any better... But does it make sense to provide that
information?

I do not see why this information is need to set up a cmake project. I need two
directories and a generator. Do I need to know what the generator produces at
that point?

Once I get the project structure I have the information on the generated
configurations -- incl. their names.

Either we should have multiConfig return a list of configuration names that will
be generated or I do not see any need to have the information in the first
place.

> > I could also not yet figure out a way to retrieve information on supported
> > platforms and toolsets. At least I did get whether a generator supports
> > toolsets, but nothing similar seems to exist for the platform part.
> 
> We don't have any information on supported platforms or toolsets.
> The CMAKE_GENERATOR_PLATFORM and CMAKE_GENERATOR_TOOLSET settings
> take user-specified values and we pass them through to native tools.
> It is up to the user to provide valid values.

Looking at the code I am a bit confused:

All the generators that take a platform seem to get that set via the generator
name. E.g. there are
* "Visual Studio 10 2010",
* "Visual Studio 10 2010 Win64" and
* "Visual Studio 10 2010 IA64"
generators registered.

All these different names trigger a new generator to be created with different
DefaultPlatformName set up (even though the documentation string for the
generators reports the Win64/IA64 part as "[arch]", not platform).

Note that "Win64" gets mapped to a platform name of "x64" and "IA64" gets mapped
to "Itanium".

So far so good...


The cmake command line lets me apparently use "-A platform" to set
cmake::GeneratorPlatform. That will end up in the cache as
"CMAKE_GENERATOR_PLATFORM" (after some validation).

Generators will get that value from the cmMakefiles (where they move into via
the CMakeCache AFAICT). That information will be passed to the generator via the
SetGeneratorPlatform method, which will then override the default platform set
via the generator name.


Why can I specify the platform names in two different ways? Why do the two ways
disagree on the platform name ("Win64" vs. "x64")? Did you rename the concept
from architecture to platform at some point (or why does the documentation use
[arch] and the command line client "-A")? I guess there are interesting
compatibility considerations behind all this:-)

What is the preferred way to set up a Visual studio project nowadays? Should I
filter out the architecture specific generators in favor or using -A on the
command line or the other way around? Or do both cover completely separate use
cases?

If "-A" is the way to go, then I would like to try my hand at adding a method to
retrieve all valid platforms for a generator. CMake has a lot of code to find
those names (or hardcodes known names), so why not pass it on to the user?

So far I only looked into the visual studio generators, so I might have missed
something that blocks such a method in other generators.

Best Regards,
Tobias

-- 
Tobias Hunger, Senior Software Engineer | The Qt Company
The Qt Company GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Mika Harjuaho. Sitz der
Gesellschaft: Berlin, Registergericht: Amtsgericht Charlottenburg, HRB 144331 B
-- 

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-developers

Reply via email to