[CMake] CMAKE 2.8.5 - CMAKE_GENERATOR Bug?

Sarnath K - ERS, HCLTech k_sarnath at hcl.com
Fri Feb 3 00:18:13 EST 2012


Hello John,

I can +vely see this behavior with the latest 2.8.7 version as well.
I am using a windows 64-bit machine with Visual studio 2008 installed on it.

This is how I use Externa Project Add command:
"
    include(ExternalProject)
    ExternalProject_Add(
        gen
        CMAKE_GENERATOR "Visual Studio 9 2008"
        URL file://${CMAKE_SOURCE_DIR}/src/tools/gen
        INSTALL_COMMAND ""
    )
"

The CMakeLists.txt hosting this ExternalProject_Add is generated using "NMake Makefiles" - which uses the default 64-bit build configuration.
A verbose Makefile generation nails the issue.
The "gen" project is generated as <cmake "-G Visual Studio 9 2008"> which screws things up.

Can somebody please help me with this?

Thanks,
Best Regards,
Sarnath
-----Original Message-----
From: John Drescher [mailto:drescherjm at gmail.com]
Sent: Thursday, February 02, 2012 11:12 PM
To: Sarnath K - ERS, HCLTech
Cc: cmake at cmake.org
Subject: Re: [CMake] CMAKE 2.8.5 - CMAKE_GENERATOR Bug?

On Thu, Feb 2, 2012 at 12:33 PM, Sarnath K - ERS, HCLTech
<k_sarnath at hcl.com> wrote:
> All,
>
>
>
> I was trying to use the external project add feature to add a 32-bit VC++
> project on a 64-bit parent build system.
>
> However, I ran into problems while compiling the 32-bit project.
>
> "devenv" used to complain "invalid solution configuration"
>
> I tried to explicitly set "CMAKE_BUILD_TYPE" using -D option as well as in
> the CMakeLists.txt.
> Nothing changed.
>
>
>
> However, when I enabled "CMAKE_VERBOSE_MAKEFILE", I found that "CMAKE" was
> "not" passing the -G option correctly.
>
> Instead of passing <cmake -G "Visual Studio 9 2008">, cmake was actually
> configuring the project as <cmake "-G Visual Studio 9 2008">
>
> (Note that -G is inside the double-quote)
>
>
>
> When I isolate the build-step and build it manually using the correct
> syntax, everything works flawlessly.
>
>
>
> Specifying the generator via "CMAKE_ARGS" helps me compile. But CMAKE still
> appends the faulty -G syntax and
>
> hence is not producing the intended results for me.
>
>
>
> If this is indeed a bug, can some one tell me:
>
> 1.    What is the temporary workaround for this?
>
> 2.    If at all fixed, how long will it take the build to come out?
>

I am not seeing this breakage. However you are 2 versions behind in cmake.

John

::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------


More information about the CMake mailing list