Re: [RFH] CMake: detect if being run via Visual Studio, independent of build generator?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Ahh, so it (MSVC) would be unset at that point no matter what at that
> early point in the code, yes?
>

yes

> >
> > To fix this I would suggest to change line:53
> >
> > -  if(MSVC AND NOT EXISTS ${VCPKG_DIR})
> > + if(CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT EXISTS ${VCPKG_DIR})
>
> I'd seen this one recommended on a few StackOverflow answers but it no
> longer works (for a new install of Visual Studio) because
> CMAKE_GENERATOR is now set to "Ninja" as default (sigh).
>
> Simply dropping the MSVC test may be one option - we are already guarded
> by the earlier WIN32 test so were aren't on another OS, though I expect
> there could be some who want to not use VS, and already have options..

I am one of them, I use clang and MSVC with Ninja.

> > and
>
> > add CMakeSettings.json to force Visual Studio to use MSBuild.
>
> I was trying to avoid requiring VS users do any extra set up steps. Too
> many steps often puts off new users, and forcing a change could be
> annoying for established users - hence the caution.
>

Yeah, I agree.

Right now, I seriously think that we need to revert
958a5f5dfe4dda4fd59af30c1d58abe43ff19d6e.
This patch also hurts command line users like me.

A more complete solution would involve adding an explicit option to use vcpkg.
This can cater to people who prefer using vcpkg and to people who
prefer using their
own packages (like me).
But this means that you have to generate the solution file using the command
line. Some people might be put off due to this extra  'single' step.

I am afraid this is a situation where you cannot make everyone happy.

Thank You,
Sibi Siddharthan



.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux