MantisBT - CMake
View Issue Details
0015662CMakeCMakepublic2015-07-23 14:202016-03-07 09:12
D.E. Goodman-Wilson 
Gilles Khouzam 
normalfeaturealways
closedfixed 
WindowsPhone 8.1Windows8.1
CMake 3.2.3 
CMake 3.4CMake 3.4 
0015662: Add support for Windows/Windows Phone SDKs with Visual Studio 2015
With Visual Studio 2015, the locations of the registry keys for the Windows SDK and WIndows Phone SDK have changed, and so the VS 2015 generator—which relies on the VS 2013 registry settings—generates errors wrongly.
On a freshly installed system with no prior installation of Visual Studio 2013, and a fresh installation of Visual Studio 2015 with Windows SDK 8.1 and Windows Phone SDK 8.1 installed, attempt to cmake a project with
set(CMAKE_SYSTEM_NAME "WindowsPhone")
set(CMAKE_SYSTEM_VERSION "8.1")

The following error is generated:

-- Building for: Visual Studio 14 2015
CMake Error at CMakeLists.txt:2 (project):
  A Windows Phone component with CMake requires both the Windows Desktop SDK
  as well as the Windows Phone '8.1' SDK. Please make sure that you have
  both installed
I can't find the new Windows Phone SDK registry keys, but they are not where cmake is expecting them for sure. The new WIndows SDK is now located at
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.1A\InstallationFolder
No tags attached.
related to 0015686closed Gilles Khouzam Windows phone projects targeting Windows 10 differ from Windows Phone 8.1 projects 
Issue History
2015-07-23 14:20D.E. Goodman-WilsonNew Issue
2015-07-23 14:31D.E. Goodman-WilsonNote Added: 0039166
2015-07-23 14:42Brad KingAssigned To => Brad King
2015-07-23 14:42Brad KingStatusnew => assigned
2015-07-23 14:42Brad KingAssigned ToBrad King => Gilles Khouzam
2015-07-23 14:43Brad KingTarget Version => CMake 3.4
2015-07-23 14:49Brad KingPriorityurgent => normal
2015-07-23 14:49Brad KingSeveritymajor => feature
2015-07-23 14:49Brad KingSummaryCMake looks in the wrong locations for Windows/Windows Phone SDKs with Visual Studio 2015 => Add support for Windows/Windows Phone SDKs with Visual Studio 2015
2015-08-06 10:53Brad KingRelationship addedrelated to 0015686
2015-09-02 10:21Brad KingNote Added: 0039365
2015-09-02 10:21Brad KingStatusassigned => resolved
2015-09-02 10:21Brad KingResolutionopen => fixed
2015-09-02 10:21Brad KingFixed in Version => CMake 3.4
2015-10-12 02:46Steve LhommeNote Added: 0039568
2015-10-12 02:52Gilles KhouzamNote Added: 0039569
2015-10-12 03:33Steve LhommeNote Added: 0039570
2015-10-12 03:42Steve LhommeNote Edited: 0039570bug_revision_view_page.php?bugnote_id=39570#r1926
2015-10-12 11:01Gilles KhouzamNote Added: 0039575
2016-03-07 09:12Robert MaynardNote Added: 0040612
2016-03-07 09:12Robert MaynardStatusresolved => closed

Notes
(0039166)
D.E. Goodman-Wilson   
2015-07-23 14:31   
Looks like on my system the WinPhone SDK install path reg entry is here:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\WindowsPhone\v8.1\Install Path
(0039365)
Brad King   
2015-09-02 10:21   
Fixed:

 VS: Find Desktop SDK for current VS version
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4b8b9168 [^]
(0039568)
Steve Lhomme   
2015-10-12 02:46   
This is working when building with the VS15 compiler. But VS15 also installs the VS13 compiler that has the runtime currently installed on Windows Phone 8/8.1. It is the preferred way to compile Windows Phone binary until Windows 10 Mobile is out.

This fix doesn't detect when it's used with the VS13 compiler and doesn't detect the proper folders for the Windows Phone SDK.
(0039569)
Gilles Khouzam   
2015-10-12 02:52   
Hi Steve,

Can you explain the issue that you're hitting and your scenario? Are you trying to build WindowsPhone 8.1 binaries in VS 2015? Are you trying to build Windows 10 Mobile binaries?
(0039570)
Steve Lhomme   
2015-10-12 03:33   
(edited on: 2015-10-12 03:42)
I am trying to build Windows Phone 8.1 binaries with VS 2015. And I'm using cmake 3.4.0-rc1 using the following command-line:

cmake -G "Visual Studio 12 2013 ARM" -DCMAKE_SYSTEM_NAME=WindowsPhone -DCMAKE_SYSTEM_VERSION=8.1 -DSHARED=OFF .

I get the following error:
  A Windows Phone component with CMake requires both the Windows Desktop SDK
  as well as the Windows Phone '8.1' SDK. Please make sure that you have
  both installed

Building without cmake by picking the right environment as follows works fine in the same environment:
call "%VS120COMNTOOLS%vsvars32.bat"
call "%VSINSTALLDIR%VC\vcvarsall.bat" x86_arm
SET WindowsPhoneKitDir=reg query "HKCU\SOFTWARE\Microsoft\Microsoft SDKs\WindowsPhoneApp\v8.1" /v "InstallationFolder"
set LIB=%VCINSTALLDIR%lib\store\arm;%WindowsPhoneKitDir%lib\arm;%LIB%
set LIBPATH=%VCINSTALLDIR%lib\store\arm;%WindowsPhoneKitDir%lib\arm;%LIB%


I'm also trying to build WinRT (Win 8.1 Store apps) x86 binaries with VS 2015. And I'm using cmake 3.4.0-rc1 using the following command-line:

cmake -G "Visual Studio 12 2013" -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=8.1 -DSHARED=OFF .

Building without cmake by picking the right environment as follows works fine in the same environment:
call "%VS120COMNTOOLS%vsvars32.bat"
call "%VSINSTALLDIR%VC\vcvarsall.bat" x86
set LIB=%VCINSTALLDIR%lib\store;%LIB%
set LIBPATH=%VCINSTALLDIR%lib\store;%LIB%

PS: it's working fine when I replace "Visual Studio 12 2013" with "Visual Studio 14 2015". But that's not what I want, I want to use the VS13 compiler with the VS13 runtime.

(0039575)
Gilles Khouzam   
2015-10-12 11:01   
Thanks for explaining your scenario. If you specify the System Version to be 8.1, then you are using the v120 toolsets (compiler and runtimes) which are the VS2013 version. You still need to specify that you want to target "Visual Studio 14 2015", which is the one that you have installed.

If you want to use the 2013 generator, then you need to have Visual studio 2013 installed.
(0040612)
Robert Maynard   
2016-03-07 09:12   
Closing resolved issues that have not been updated in more than 4 months.