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.