-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdiasdk.cmake
28 lines (21 loc) · 871 Bytes
/
diasdk.cmake
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
include_guard(GLOBAL)
set(DIA_SDK_ROOT ${CMAKE_CURRENT_LIST_DIR}/dia_sdk CACHE PATH "Location of the DIA SDK")
find_file(DIA2_H_PATH dia2.h PATHS ${DIA_SDK_ROOT}/include)
if(NOT DIA2_H_PATH)
message(FATAL_ERROR "Could not find the DIA SDK")
endif()
add_library(DIA STATIC IMPORTED GLOBAL)
if(8 EQUAL ${CMAKE_SIZEOF_VOID_P})
set(DIA_DLL ${DIA_SDK_ROOT}/bin/amd64/msdia140.dll)
set_target_properties(DIA PROPERTIES IMPORTED_LOCATION ${DIA_SDK_ROOT}/lib/amd64/diaguids.lib)
else()
set(DIA_DLL ${DIA_SDK_ROOT}/bin/msdia140.dll)
set_target_properties(DIA PROPERTIES IMPORTED_LOCATION ${DIA_SDK_ROOT}/lib/diaguids.lib)
endif()
target_include_directories(DIA
INTERFACE ${DIA_SDK_ROOT}/include
${DIA_SDK_ROOT}/idl
)
if(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
file(COPY ${DIA_DLL} DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()