The test RunCMake.try_compile fails for Visual Studio 2012 builds
Building CMake on Windows 7 64bit, using CMake 3.7.1 for building, built latest revision (aff368bb)
Sorry, I don't understand where this error comes from so I cannot provide a hint.
I tested it on several machines with 32bit and 64bit builds, no success.
Visual Studio 2010, 2013 and 2015 run fine.
Here is the Logfile content:
Test Name: 354: RunCMake.try_compile
Test FullName: RunCMake.try_compile
Test Source: C:\cmake\Tests\RunCMake\CTestTestfile.cmake : line 976
Test Outcome: Failed
Test Duration: 0:00:32.7
Result Message:
-- CopyFileErrorNoCopyFile - PASSED
-- NoArgs - PASSED
-- OneArg - PASSED
-- TwoArgs - PASSED
-- NoCopyFile - PASSED
-- NoCopyFile2 - PASSED
-- NoCopyFileError - PASSED
-- NoOutputVariable - PASSED
-- NoOutputVariable2 - PASSED
-- NoSources - PASSED
-- BadLinkLibraries - PASSED
-- BadSources1 - PASSED
-- BadSources2 - PASSED
-- NonSourceCopyFile - PASSED
-- NonSourceCompileDefinitions - PASSED
-- PlatformVariables - PASSED
-- WarnDeprecated - PASSED
-- TargetTypeExe - PASSED
-- TargetTypeInvalid - PASSED
-- TargetTypeStatic - PASSED
-- CxxStandardNoDefault - PASSED
-- CMP0056 - PASSED
CMake Error at E:/cmake_orig/Tests/RunCMake/RunCMake.cmake:132 (message):
CMP0066 - FAILED:
Result is [1], not [0].
stdout does not match that expected.
stderr does not match that expected.
Expected stdout to match:
expect-out> -- try_compile with CMP0066 WARN-default worked as expected
expect-out> -- try_compile with CMP0066 WARN-enabled worked as expected
expect-out> -- try_compile with CMP0066 OLD worked as expected
expect-out> -- try_compile with CMP0066 NEW worked as expected
Actual stdout:
actual-out> Not searching for unused variables given on the command line.
actual-out> -- The C compiler identification is MSVC 17.0.61030.0
actual-out> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe
actual-out> -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 11.0/VC/bin/cl.exe -- works
actual-out> -- Detecting C compiler ABI info
actual-out> -- Detecting C compiler ABI info - done
actual-out> -- try_compile with CMP0066 WARN-default worked as expected
actual-out> -- try_compile with CMP0066 WARN-enabled worked as expected
actual-out> -- try_compile with CMP0066 OLD worked as expected
actual-out> -- Configuring incomplete, errors occurred!
actual-out> See also "C:/cmake/Tests/RunCMake/try_compile/CMP0066-build/CMakeFiles/CMakeOutput.log".
Expected stderr to match:
expect-err> before try_compile with CMP0066 WARN-default
expect-err> after try_compile with CMP0066 WARN-default
expect-err> *
expect-err> CMake Warning \(dev\) at CMP0066.cmake:[0-9]+ \(try_compile\):
expect-err> Policy CMP0066 is not set: Honor per-config flags in try_compile\(\)
expect-err> source-file signature. Run "cmake --help-policy CMP0066" for policy
expect-err> details. Use the cmake_policy command to set the policy and suppress this
expect-err> warning.
expect-err>
expect-err> For compatibility with older versions of CMake, try_compile is not honoring
expect-err> caller config-specific compiler flags \(e.g. CMAKE_C_FLAGS_DEBUG\) in the
expect-err> test project.
expect-err> Call Stack \(most recent call first\):
expect-err> CMakeLists.txt:[0-9]+ \(include\)
expect-err> This warning is for project developers. Use -Wno-dev to suppress it.$
Actual stderr:
actual-err> before try_compile with CMP0066 WARN-default
actual-err> after try_compile with CMP0066 WARN-default
actual-err> CMake Warning (dev) at CMP0066.cmake:21 (try_compile):
actual-err> Policy CMP0066 is not set: Honor per-config flags in try_compile()
actual-err> source-file signature. Run "cmake --help-policy CMP0066" for policy
actual-err> details. Use the cmake_policy command to set the policy and suppress this
actual-err> warning.
actual-err>
actual-err> For compatibility with older versions of CMake, try_compile is not honoring
actual-err> caller config-specific compiler flags (e.g. CMAKE_C_FLAGS_DEBUG) in the
actual-err> test project.
actual-err> Call Stack (most recent call first):
actual-err> CMakeLists.txt:3 (include)
actual-err> This warning is for project developers. Use -Wno-dev to suppress it.
actual-err>
actual-err> CMake Error at CMP0066.cmake:55 (message):
actual-err> try_compile with CMP0066 NEW did not fail with PP_ERROR:
actual-err>
actual-err> Change Dir: C:/cmake/Tests/RunCMake/try_compile/CMP0066-build/CMakeFiles/CMakeTmp
actual-err>
actual-err> Run Build Command:"C:/Windows/Microsoft.NET/Framework/v4.0.30319/MSBuild.exe" "cmTC_3a3cf.vcxproj" "/p:Configuration=Release" "/p:VisualStudioVersion=11.0"
actual-err> Microsoft (R) Build Engine version 4.6.1590.0
actual-err> [Microsoft .NET Framework, version 4.0.30319.42000]
actual-err> Copyright (C) Microsoft Corporation. All rights reserved.
actual-err>
actual-err> Build started 1/10/2017 11:18:01 AM.
actual-err> Project "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj" on node 1 (default targets).
actual-err> PrepareForBuild:
actual-err> Creating directory "cmTC_3a3cf.dir\Release\".
actual-err> Creating directory "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\Release\".
actual-err> InitializeBuildStatus:
actual-err> Creating "cmTC_3a3cf.dir\Release\cmTC_3a3cf.unsuccessfulbuild" because "AlwaysCreate" was specified.
actual-err> ClCompile:
actual-err> C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D PP_ERROR /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_3a3cf.dir\Release\\" /Fd"cmTC_3a3cf.dir\Release\vc110.pdb" /Gd /TC /analyze- /errorReport:queue E:\cmake_orig\Tests\RunCMake\try_compile\src.c
actual-err> Microsoft (R) C/C++ Optimizing Compiler Version 17.00.61030 for x86
actual-err> Copyright (C) Microsoft Corporation. All rights reserved.
actual-err>
actual-err> cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D PP_ERROR /D "CMAKE_INTDIR=\"Release\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"cmTC_3a3cf.dir\Release\\" /Fd"cmTC_3a3cf.dir\Release\vc110.pdb" /Gd /TC /analyze- /errorReport:queue E:\cmake_orig\Tests\RunCMake\try_compile\src.c
actual-err>
actual-err> src.c
actual-err> E:\cmake_orig\Tests\RunCMake\try_compile\src.c(6): fatal error C1004: unexpected end-of-file found [C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj]
actual-err> Done Building Project "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj" (default targets) -- FAILED.
actual-err>
actual-err> Build FAILED.
actual-err>
actual-err> "C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj" (default target) (1) ->
actual-err> (ClCompile target) ->
actual-err> E:\cmake_orig\Tests\RunCMake\try_compile\src.c(6): fatal error C1004: unexpected end-of-file found [C:\cmake\Tests\RunCMake\try_compile\CMP0066-build\CMakeFiles\CMakeTmp\cmTC_3a3cf.vcxproj]
actual-err>
actual-err> 0 Warning(s)
actual-err> 1 Error(s)
actual-err>
actual-err> Time Elapsed 00:00:00.13
actual-err>
actual-err> Call Stack (most recent call first):
actual-err> CMakeLists.txt:3 (include)
Call Stack (most recent call first):
E:/cmake_orig/Tests/RunCMake/try_compile/RunCMakeTest.cmake:49 (run_cmake)
-- CMP0067 - PASSED