-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathCMakeLists.txt
103 lines (54 loc) · 2.4 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#
# VKTS Example CMake file.
#
cmake_minimum_required(VERSION 3.2)
set (VKTS_Example "VKTS_Example08")
project (${VKTS_Example})
set(VKTS_WSI "VKTS_NO_DISPLAY" CACHE STRING "Keep VKTS_NO_VISUAL for no WSI.")
add_definitions(-DVKTS_NO_VISUAL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../VKTS_External/include ${CMAKE_CURRENT_SOURCE_DIR}/../VKTS/include)
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
set(VKTS_ARCHITECTURE "arm")
else ()
set(VKTS_ARCHITECTURE "intel")
endif ()
if (CMAKE_SIZEOF_VOID_P MATCHES 8)
set(VKTS_BITS "64")
else ()
set(VKTS_BITS "32")
endif ()
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(VKTS_OS "Windows")
set(VKTS_WINDOW "Win32")
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
set(VKTS_COMPILER "MSVC")
set(VKTS_LIB ${VKTS_COMPILER}/lib)
else ()
set(VKTS_COMPILER "GNU")
set(VKTS_LIB "lib")
endif ()
set(VKTS_ADDITIONAL_LIBS vulkan-1 WinMM Xinput9_1_0)
include_directories(AFTER C:/VulkanSDK/1.0.8.0/Include)
if (${VKTS_BITS} MATCHES "64")
link_directories(C:/VulkanSDK/1.0.8.0/Bin)
else ()
link_directories(C:/VulkanSDK/1.0.8.0/Bin32)
endif ()
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(VKTS_OS "Linux")
set(VKTS_WINDOW "Xlib")
set(VKTS_COMPILER "GNU")
set(VKTS_LIB "lib")
set(VKTS_ADDITIONAL_LIBS vulkan pthread xcb X11-xcb Xrandr X11)
endif ()
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../VKTS/${VKTS_LIB})
file(GLOB_RECURSE CPP_FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
add_executable(${VKTS_Example} ${CPP_FILES})
set_property(TARGET ${VKTS_Example} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../VKTS_Binaries)
set_property(TARGET ${VKTS_Example} PROPERTY RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_SOURCE_DIR}/../VKTS_Binaries)
set_property(TARGET ${VKTS_Example} PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/../VKTS_Binaries)
set_property(TARGET ${VKTS_Example} PROPERTY RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_CURRENT_SOURCE_DIR}/../VKTS_Binaries)
set_property(TARGET ${VKTS_Example} PROPERTY RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_CURRENT_SOURCE_DIR}/../VKTS_Binaries)
set_property(TARGET ${VKTS_Example} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${VKTS_Example} PROPERTY CXX_STANDARD_REQUIRED ON)
target_link_libraries(${VKTS_Example} VKTS ${VKTS_ADDITIONAL_LIBS})