-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
82 lines (72 loc) · 2.16 KB
/
CMakeLists.txt
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
cmake_minimum_required (VERSION 3.12)
project (fps_inspector_sdk)
macro(configure_msvc_runtime)
if(MSVC)
# Default to statically-linked runtime.
if("${MSVC_RUNTIME}" STREQUAL "")
set(MSVC_RUNTIME "static")
endif()
# Set compiler options.
set(variables
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
if(${MSVC_RUNTIME} STREQUAL "static")
message(STATUS
"MSVC -> forcing use of statically-linked runtime."
)
foreach(variable ${variables})
if(${variable} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}")
endif()
endforeach()
else()
message(STATUS
"MSVC -> forcing use of dynamically-linked runtime."
)
foreach(variable ${variables})
if(${variable} MATCHES "/MT")
string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}")
endif()
endforeach()
endif()
endif()
endmacro()
configure_msvc_runtime ()
include_directories (
inc
src/utils/inc
)
link_directories (
lib
)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_SOURCE_DIR}/python/fps_inspector_sdk/lib)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_SOURCE_DIR}/python/fps_inspector_sdk/lib)
add_library (
PresentData STATIC
src/PresentData/LateStageReprojectionData.cpp
src/PresentData/MixedRealityTraceConsumer.cpp
src/PresentData/PresentMonTraceConsumer.cpp
src/PresentData/SwapChainData.cpp
src/PresentData/TraceConsumer.cpp
)
set_target_properties(PresentData PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib/PresentData/"
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib/PresentData/"
)
add_library (
PresentMon SHARED
src/PresentMon/TraceSession.cpp
src/PresentMon/PresentMon.cpp
src/PresentMon/Privilege.cpp
src/PresentMon/Logger.cpp
src/Utils/timing.cpp
)
set (CMAKE_SHARED_LINKER_FLAGS "dwmapi.lib")
target_link_libraries(PresentMon PresentData Shlwapi Tdh)