0

When I add a test target with CMake's ExternalData, i.e.

include(ExternalData)
set(ExternalData_URL_TEMPLATES "http://ntctestdata/SoftwareTestData/AutomatedTests/%(algo)/%(hash)")

ExternalData_Add_Test(it_SdfFullData
   NAME it_SdfFull
   COMMAND it_SdfFull
)

ExternalData_Add_Target(it_SdfFullData)

Visual Studio 2013 (MSVC 12) throws this build error:

Build FAILED.

   "c:\...\build_dir\ALL_BUILD.vcxproj" (default target) (1) ->
   "C:\...\build_dir\...\test\it_Full\it_SdfFullData.vcxproj" (default target) (218) ->
   (PrepareForBuild target) -> 
     C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(376,5): error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library. See http://go.microsoft.com/fwlink/p/?LinkId=286820 for more information. [C:\...\build_dir\...\test\it_Full\it_SdfFullData.vcxproj]

It took me a long time to narrow it down to this. I'm confused because I do virtually the exact same thing in another CMake file in a sibling project, plus the actual test builds. It seems that ExternalData_Add_Test is adding a non-unicode test or something to the solution built by CMake.

I do have add_definitions(-DUNICODE -D_UNICODE) set in a parent CMake file.

What is more confusing is that this builds on my local system (and also all non-MSVC compilers), just not on our CI build systems (... where it matters.), even though the environments are the same.

Matt
  • 1,928
  • 24
  • 44
  • Did you install the MBCS MFC package? See here: http://stackoverflow.com/questions/19603680/mbcs-error-building-mfc-c-project-with-visual-studio – Simon Kraemer Nov 14 '16 at 16:46
  • I saw this response, and I'm not 100% sure that it's installed (we did install Update 5.) But I have a sibling project that uses the virtually the exact same setup which builds fine (literally right above it in the console output log) on the same machine. So I'd be worried about modifying Visual Studio on our CI machine. – Matt Nov 14 '16 at 16:53

0 Answers0