[CMake] Using CMake with WEC 2013 and VS 2015

Aleksandar Fabijanic aleskx at gmail.com
Mon Sep 4 13:37:53 EDT 2017


Hello,

I am trying to generate a VS 2015 project for a WEC 2015 (CMakeLists.txt
works fine for generation of the projects for "regular" VC 2015 platform
target). I have the WEC, Platform builder etc installed, my SDK (SDK1)
built and installed; I can create and build a "hello world" console app for
CE800 Platform Toolset using the wizard in VS GUI IDE.

However, when I try to use CMake to generate VS 2015 project(s):

λ cat ..\cmake\WEC2013.cmake
set(CMAKE_SYSTEM_NAME WindowsCE)
set(CMAKE_SYSTEM_VERSION 8.0)
set(CMAKE_SYSTEM_PROCESSOR arm)
set(CMAKE_GENERATOR_TOOLSET CE800)
set(CMAKE_GENERATOR_PLATFORM SDK1)

λ cmake --debug-trycompile -DCMAKE_TOOLCHAIN_FILE=..\WEC2013.cmake ..

 I run into following problem (comments in /**/ are mine, unimportant
portions of cmake output cut out for clarity):

<Begin CMake output>
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 17.0.50727.114
-- The CXX compiler identification is MSVC 17.0.50727.114
-- Check for working C compiler: C:/Program Files (x86)/Windows CE
Tools/SDKs/SDK1/Sdk/bin/i386/X86/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Windows CE
Tools/SDKs/SDK1/Sdk/bin/i386/X86/cl.exe -- broken

/* ... */

/* this warning also shows in the GUI "hello world", but it does not
prevent it to build - I tried many recipes to get rid of it but none worked
*/
 C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5):
 warning MSB8003: Could not find WindowsSDKDir variable from the registry.
TargetFrameworkVersion or PlatformToolset may be set to an invalid version
number.

/* ... */

 ClCompile:





   C:\Program Files (x86)\Windows CE
Tools\SDKs\SDK1\sdk\bin\i386\x86\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D
_WIN32_WCE=0x800 /D UNDER_CE /D WINCE /D X86 /D _X86_ /D _WINDOWS /D
"CMAKE_INTDIR=\"Deb
g\"" /D UNDER_CE /D WINCE /D _WIN32_WCE=0x800 /D x86 /D _X86_ /D _USESTL /D
_MBCS /Gm- /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline
/Fo"cmTC_c8221.dir\Debug\\" /Fd"cmTC_c8221.dir\Debug\v
140.pdb" /Gd /TC /analyze- /errorReport:queue /arch:IA32
C:\Temp\cmake_build\CMakeFiles\CMakeTmp\testCCompiler.c

/* ... */



   cl /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D _WIN32_WCE=0x800 /D UNDER_CE /D
WINCE /D X86 /D _X86_ /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /D UNDER_CE
/D WINCE /D _WIN32_WCE=0x800 /D x86 /D _X86_ /D _USESTL /D _MBCS /Gm- /MDd
/GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline
/Fo"cmTC_c8221.dir\Debug\\" /Fd"cmTC_c8221.dir\Debug\vc140.pdb" /Gd /TC
/analyze- /errorReport:queue /arch:IA32
C:\Temp\cmake_build\CMakeFiles\CMakeTmp\testCCompiler.c



 cl : Command line warning D9002: ignoring unknown option '/Zc:inline'


 [C:\Users\alex\poco\cmake_build\CMakeFiles\CMakeTmp\cmTC_c8221.vcxproj]

   testCCompiler.c





 Link:





   C:\Program Files (x86)\Windows CE
Tools\SDKs\SDK1\sdk\bin\i386\x86\link.exe /ERRORREPORT:QUEUE
/OUT:"C:\Temp\cmake_build\CMakeFiles\CMakeTmp\Debug\cmTC_c8221.exe"
/INCREMENTAL /NOLOGO
oredll.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib
/NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib /MANIFEST /MANIFESTUAC:NO
/DEBUG /PDB:"C:/Temp/cmake_build/CMakeFiles/CMakeTmp/Debug/cmTC_c8221.pdb"
/SUBSYSTEM:WINDOWSCE /TLBID:1 /ENTRY:"mainACRTStartup" /DYNAMICBASE
/NXCOMPAT
/IMPLIB:"C:/Temp/cmake_build/CMakeFiles/CMakeTmp/Debug/cmTC_c8221.lib"
/MACHINE:X86 /SAFESH  /machine:X86 cmTC_c8221.dir\Debug\testCCompiler.obj





 LINK : fatal error LNK1104: cannot open file 'ole32.lib'


 [C:\Temp\cmake_build\CMakeFiles\CMakeTmp\cmTC_c8221.vcxproj]
                                                                     </End
CMake output>

Since I run cmake with `--debug-trycompile`, I can subsequently open the
generated temporary `cmTC_c8221.vcxproj`, add the missing lib directories
(after I add the one for ole32.lib, there are also errors for uuid.lib and
commctrl.lib), and the project will build. But I would expect this process
to generate "out of the box", without errors.

Am I not doing something right here or is this a CMake-related problem?

Thanks in advance for any help.

Alex

<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20170904/e32824be/attachment-0001.html>


More information about the CMake mailing list