@ -6,34 +6,62 @@ endif()
set ( HAVE_WINRT FALSE )
# s e a r c h W i n d o w s P l a t f o r m S D K
message ( STATUS "Checking for Windows Platform SDK" )
GET_FILENAME_COMPONENT ( WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE )
if ( WINDOWS_SDK_PATH STREQUAL "" )
set ( HAVE_MSPDK FALSE )
message ( STATUS "Windows Platform SDK 8.0 was not found" )
# s e a r c h Windows ( Phone ) P l a t f o r m S D K
message ( STATUS "Checking for Windows (Phone) Platform SDK 8.0/8.1" )
unset ( WINDOWS_SDK_PATH CACHE )
GET_FILENAME_COMPONENT ( WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhoneApp\\v8.1;InstallationFolder]" ABSOLUTE CACHE )
if ( ( NOT ENABLE_WINPHONESDK81 ) OR ( NOT ( MSVC_VERSION EQUAL 1800 ) ) OR ( WINDOWS_SDK_PATH STREQUAL "" ) )
unset ( WINDOWS_SDK_PATH CACHE )
GET_FILENAME_COMPONENT ( WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\WindowsPhone\\v8.0;InstallationFolder]" ABSOLUTE CACHE )
if ( ( NOT ENABLE_WINPHONESDK80 ) OR ( MSVC_VERSION LESS 1700 ) OR ( WINDOWS_SDK_PATH STREQUAL "" ) )
unset ( WINDOWS_SDK_PATH CACHE )
GET_FILENAME_COMPONENT ( WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]" ABSOLUTE CACHE )
if ( ( NOT ENABLE_WINSDK81 ) OR ( NOT ( MSVC_VERSION EQUAL 1800 ) ) OR ( WINDOWS_SDK_PATH STREQUAL "" ) )
set ( HAVE_MSPDK FALSE )
unset ( WINDOWS_SDK_PATH CACHE )
GET_FILENAME_COMPONENT ( WINDOWS_SDK_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]" ABSOLUTE CACHE )
if ( WINDOWS_SDK_PATH STREQUAL "" )
set ( HAVE_MSPDK FALSE )
message ( STATUS "Windows (Phone) Platform SDK 8.0/8.1 was not found" )
else ( )
set ( HAVE_MSPDK TRUE )
endif ( )
else ( )
set ( HAVE_MSPDK TRUE )
endif ( )
else ( )
set ( HAVE_MSPDK TRUE )
endif ( )
else ( )
set ( HAVE_MSPDK TRUE )
endif ( )
# s e a r c h f o r V i s u a l S t u d i o 1 1 . 0 i n s t a l l d i r e c t o r y
message ( STATUS "Checking for Visual Studio 2012" )
GET_FILENAME_COMPONENT ( VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE )
if ( VISUAL_STUDIO_PATH STREQUAL "" )
set ( HAVE_MSVC2012 FALSE )
message ( STATUS "Visual Studio 2012 was not found" )
# s e a r c h f o r V i s u a l S t u d i o 1 1 . 0 / 1 2 . 0 i n s t a l l d i r e c t o r y
message ( STATUS "Checking for Visual Studio 2012/2013" )
unset ( VISUAL_STUDIO_PATH CACHE )
GET_FILENAME_COMPONENT ( VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VS;ProductDir] REALPATH CACHE )
if ( ( NOT ENABLE_LIBVS2013 ) OR ( NOT ( MSVC_VERSION EQUAL 1800 ) ) OR ( VISUAL_STUDIO_PATH STREQUAL "" ) )
set ( HAVE_MSVC2013 FALSE )
unset ( VISUAL_STUDIO_PATH CACHE )
GET_FILENAME_COMPONENT ( VISUAL_STUDIO_PATH [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] REALPATH CACHE )
if ( VISUAL_STUDIO_PATH STREQUAL "" )
set ( HAVE_MSVC2012 FALSE )
message ( STATUS "Visual Studio 2012/2013 not found" )
else ( )
set ( HAVE_MSVC2012 TRUE )
endif ( )
else ( )
set ( HAVE_MSVC2012 TRUE )
set ( HAVE_MSVC2013 TRUE )
endif ( )
try_compile ( HAVE_WINRT_SDK
" $ { O p e n C V _ B I N A R Y _ D I R } "
" $ { O p e n C V _ S O U R C E _ D I R } / c m a k e / c h e c k s / w i n r t t e s t . c p p " )
if ( ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK )
if ( ENABLE_WINRT_MODE AND HAVE_WINRT_SDK AND ( HAVE_MSVC2012 OR HAVE_MSVC2013 ) AND HAVE_MSPDK )
set ( HAVE_WINRT TRUE )
set ( HAVE_WINRT_CX TRUE )
elseif ( ENABLE_WINRT_MODE_NATIVE AND HAVE_WINRT_SDK AND HAVE_MSVC2012 AND HAVE_MSPDK )
elseif ( ENABLE_WINRT_MODE_NATIVE AND HAVE_WINRT_SDK AND ( HAVE_MSVC2012 OR HAVE_MSVC2013 ) AND HAVE_MSPDK )
set ( HAVE_WINRT TRUE )
set ( HAVE_WINRT_CX FALSE )
endif ( )