Using CMake with WEC 2013 and VS 2015

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Using CMake with WEC 2013 and VS 2015

Aleksandar Fabijanic

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

λ 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.

/* ... */

   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:\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.




Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: