-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig_platform_sdk.cmake
More file actions
110 lines (84 loc) · 3.01 KB
/
Copy pathconfig_platform_sdk.cmake
File metadata and controls
110 lines (84 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
if( WINSDK_FOUND )
return()
endif()
message( STATUS ">>> config_platform_sdk.cmake >>>" )
set( WINSDK_FOUND False )
if( MOTOR_TARGET_OS_WIN7 )
message( STATUS "[WindowsSDK] : Win 7 SDK" )
message( "[WindowsSDK] : Win 7 is outdated." )
if( MOTOR_TARGET_ARCH_BIT_64 )
set( INT_ARCH "/x64" )
endif()
set( SEARCH_WINSDK_INCLUDE_PATHS
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Include"
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Include"
$ENV{WINSDK_INCLUDEDIR_UM}
)
set( WINSDK_LIBRARIES_SEARCH_PATHS
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.1A/Lib${INT_ARCH}"
"C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib${INT_ARCH}"
$ENV{WINSDK_LIBRARYDIR_UM}
)
elseif( MOTOR_TARGET_OS_WIN81 )
message( STATUS "[WindowsSDK] : Win 8.1 SDK" )
message( "[WindowsSDK] : Win 8 is outdated." )
if( MOTOR_TARGET_ARCH_BIT_64 )
set( INT_ARCH "/x64" )
endif()
set( SEARCH_WINSDK_INCLUDE_PATHS
"C:/Program Files (x86)/Windows Kits/8.1/Include/um"
$ENV{WINSDK_INCLUDEDIR_UM}
)
set( WINSDK_LIBRARIES_SEARCH_PATHS
"C:/Program Files (x86)/Windows Kits/8.1/Lib/winv6.3/um${INT_ARCH}"
$ENV{WINSDK_LIBRARYDIR_UM}
)
elseif( MOTOR_TARGET_OS_WIN10 )
message( STATUS "[WindowsSDK] : Win 10 SDK" )
if( MOTOR_TARGET_ARCH_BIT_64 )
set( INT_ARCH "/x64" )
endif()
#todo somehow allow user to add more paths
set( sdk_bases "C:/Program Files (x86)/Windows Kits" )
foreach( sdk_base ${sdk_bases} )
# 1: check if the bases exist
set( sdk_inc "${sdk_base}/10/Include" )
set( sdk_lib "${sdk_base}/10/Lib" )
if( NOT EXISTS ${sdk_inc} OR NOT EXISTS ${sdk_lib} )
continue()
endif()
# 2: check if the subdirectories exist and select the right one
set( sdk_version ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION} )
#message( "${sdk_inc}/${sdk_version}" )
if( NOT EXISTS "${sdk_inc}/${sdk_version}" )
set( sdk_version "" )
set( directories "" )
subdirectories( directories ${sdk_inc} )
list( FILTER directories INCLUDE REGEX "^10(\.[0-9])*" )
list( REVERSE directories )
foreach( subdir ${directories} )
if( EXISTS ${sdk_inc}/${subdir} )
set( sdk_version ${subdir} )
break()
endif()
endforeach()
unset( directories )
endif()
# 3: lets just assume, the default SDK install directory is given
set( sdk_inc "${sdk_inc}/${sdk_version}" )
set( sdk_lib "${sdk_lib}/${sdk_version}" )
message( STATUS "[WindowsSDK] : ${sdk_inc}" )
break()
endforeach()
unset( sdk_version )
set( MOTOR_WINSDK_INCLUDE_PATHS
"${sdk_inc}/um"
$ENV{WINSDK_INCLUDEDIR_UM}
)
set( MOTOR_WINSDK_LIBRARY_PATHS
"${sdk_lib}/um${INT_ARCH}"
$ENV{WINSDK_LIBRARYDIR_UM}
)
endif()
message( STATUS "<<< config_platform_sdk.cmake <<<" )
set( WINSDK_FOUND True )