I tried this with a CMakeLists file that contains only a PROJECT and ADD_EXECUTABLE (with a single C++ source file). The only things present in the directory before running CMake were the C++ file, CMakeLists.txt, and a batch file that I used to run CMake. I still get the "requires elevation" error even when I run cmake.exe from a command line as administrator. It also doesn't seem to matter whether I select Visual Studio 10 or Visual Studio 10 Win64 as my generator.
I thought maybe the problem was that I didn't "install" CMake, rather (as I've been doing for years, due to the way this project is version-controlled) I set CMAKE_ROOT to a directory that happens to contain the CMake files and then ran a copy of cmake.exe. I just tried the exercise again after doing a regular installation of CMake 3.1.0 (using default choices only) and came up with the same result. (Actually not quite: now -G "Visual Studio 10" says "The C compiler identification is unknown", and only -G "Visual Studio 10 Win64" produces the "elevation" error, whereas with my previous uninstalled version both generators resulted in "elevation".) David > -----Original Message----- > From: David Cole [mailto:dlrd...@aol.com] > Sent: Wednesday, January 07, 2015 10:58 AM > To: Karr, David A. @ EngilityCorp > Cc: cmake@cmake.org > Subject: Re: [CMake] Unable to create project files with Visual Studio > 2010 on Windows 7 > > The "The requested operation requires elevation." message indicates > some sort of permissions problem (admin privileges...) > > Did you run VS and/or CMake as an admin one time, and then not as an > admin a second time...? > > It should work with either all-non-admin runs or all-admin runs, but > you probably can't mix-n-match from run to run. > > Can you start with a very simple hello world app, in a brand new "empty > to start with" directory, and run CMake and VS without admin > privileges? > > Or do you get exactly the same thing if you do that? > > > D > > > > On Tue, Jan 6, 2015 at 7:10 PM, <david.k...@engilitycorp.com> wrote: > > I have just started using a new Windows 7 host with Visual Studio > 2010 > > Professional. When I call CMake to generate my project files, I get > > the following output in CMakeError.log: > > > > ========================== > > Determining if the C compiler works failed with the following output: > > Change Dir: > C:/________________________/__________/CMakeFiles/CMakeTmp > > > > Run Build > > Command:C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe > > cmTryCompileExec.vcxproj /p:Configuration=Debug Microsoft (R) Build > > Engine version 4.0.30319.17929 [Microsoft .NET Framework, version > > 4.0.30319.18034] Copyright (C) Microsoft Corporation. All rights > > reserved. > > > > Build started 1/6/2015 6:15:19 PM. > > Project > > > "C:\________________________\__________\CMakeFiles\CMakeTmp\cmTryCompil > eExec.vcxproj" > > on node 1 (default targets). > > InitializeBuildStatus: > > Creating > "cmTryCompileExec.dir\Debug\cmTryCompileExec.unsuccessfulbuild" > > because "AlwaysCreate" was specified. > > ClCompile: > > C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe > /c > > /Zi /nologo /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D > > "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise > > /Zc:wchar_t /Zc:forScope /Fo"cmTryCompileExec.dir\Debug\\" > > > /Fd"C:/________________________/__________/CMakeFiles/CMakeTmp/Debug/cm > TryCompileExec.pdb" > > /Gd /TC /analyze- /errorReport:queue testCCompiler.c /Zm1000 TRACKER > > : error TRK0002: Failed to execute command: ""C:\Program Files > > (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" > > > @C:\Users\nnnnnnnnnnnn\AppData\Local\Temp\tmp9db9bf329c554cb8be447cdb72 > 535c4e.rsp". > > The requested operation requires elevation. > > > [C:\________________________\__________\CMakeFiles\CMakeTmp\cmTryCompi > > leExec.vcxproj] > > > > > > Done Building Project > > > "C:\________________________\__________\CMakeFiles\CMakeTmp\cmTryCompil > eExec.vcxproj" > > (default targets) -- FAILED. > > > > Build FAILED. > > > > > "C:\________________________\__________\CMakeFiles\CMakeTmp\cmTryCompil > eExec.vcxproj" > > (default target) (1) -> > > (ClCompile target) -> > > TRACKER : error TRK0002: Failed to execute command: ""C:\Program > > Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe" > > > @C:\Users\nnnnnnnnnnnn\AppData\Local\Temp\tmp9db9bf329c554cb8be447cdb72 > 535c4e.rsp". > > The requested operation requires elevation. > > > [C:\________________________\__________\CMakeFiles\CMakeTmp\cmTryCompi > > leExec.vcxproj] > > > > 0 Warning(s) > > 1 Error(s) > > > > Time Elapsed 00:00:00.10 > > ========================== > > > > The only thing I've changed in the output text is I replaced some > > user-specific directory names with underscores or "nnnnnnnnnnnn". > > > > This project previously built just fine on Windows XP. Moreover, my > > coworker, who as far as we can tell set up his Windows 7 host the > same > > way I did (modulo some things that shouldn't matter, such as I have a > > copy of Emacs and he doesn't), is able to build the same project > files > > without error. > > > > It may be noteworthy that after this failure, the file > > CMakeFiles\CMakeTmp\cmTryCompileExec.vcxproj does not exist, and > there > > are no files whatsoever in > CMakeFiles\CMakeTmp\cmTryCompileExec.dir\Debug. > > > > I have been trying all kinds of suggestions I have found by looking > up > > the message "The requested operation requires elevation." I have > tried > > setting ownership of the directories (it turns out I owned them all > > along), I have tried setting access rights (already set to full > > access), I tried turning off UAC, and I even tried repairing the > installation of Visual Studio 2010. > > None of it made any difference. > > > > I've found some Web sites where some people have complained of > > problems when they had installed Visual Studio 2012 and tried to use > Visual Studio 2010. > > But Visual Studio 2010 is the only version that has been installed on > > this host. > > > > This has had me dead in the water for at least a day, unable to make > > any progress on my actual project. Does anyone have any ideas about > > where to even begin to look for solutions I haven't already tried? > > > > David > > > > > > > > > > -- > > > > 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 -- 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