forked from baldurk/renderdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
62 lines (49 loc) · 1.74 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
cmake_minimum_required(VERSION 2.8.12)
if(WIN32)
message(FATAL_ERROR "CMake is not needed on Windows, just open and build renderdoc.sln")
endif()
# disallow in-source builds because we have a top-level wrapper Makefile
if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR "In-source builds not allowed")
endif()
project(RenderDoc CXX C)
option(ENABLE_GL "Enable GL driver" ON)
option(ENABLE_VULKAN "Enable Vulkan driver" ON)
option(ENABLE_RENDERDOCCMD "Enable renderdoccmd" ON)
option(ENABLE_QRENDERDOC "Enable qrenderdoc" ON)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set(warning_flags
-Wall
-Wextra
-Werror
-Wno-unused-variable
-Wno-type-limits
-Wno-unused-parameter
-Wno-missing-field-initializers
-Wno-unknown-pragmas
-Wno-reorder)
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND warning_flags -Wno-unused-but-set-variable)
endif()
string(REPLACE ";" " " warning_flags "${warning_flags}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${warning_flags}")
endif()
add_definitions(-DRENDERDOC_PLATFORM_POSIX)
if(ANDROID)
add_definitions(-DRENDERDOC_PLATFORM_ANDROID)
elseif(APPLE)
add_definitions(-DRENDERDOC_PLATFORM_APPLE)
elseif(UNIX)
add_definitions(-DRENDERDOC_PLATFORM_LINUX)
endif()
add_subdirectory(renderdoc)
if(ENABLE_RENDERDOCCMD)
add_subdirectory(renderdoccmd)
endif()
if(ENABLE_QRENDERDOC)
add_subdirectory(qrenderdoc)
endif()