Files
renderdoc/renderdoccmd/CMakeLists.txt
T
baldurk 872fbe017b Make xlib and xcb support optional (but default on) on linux
* Also allow disabling GL a little better by removing the dependency in
  renderdoccmd.
* Disabling them now completely removes all xcb and xlib build
  dependencies. The resulting library/executable is only useful in
  limited situations - e.g. replaying vulkan remotely which doesn't need
  any window system interaction. Or capturing vulkan as well with the
  KHR_display WSI extension which doesn't need any built-time includes
  or libs.
2016-08-23 16:25:21 +02:00

44 lines
1.2 KiB
CMake

set(sources renderdoccmd.cpp)
set(includes PRIVATE ${CMAKE_SOURCE_DIR}/renderdoc/api)
set(libraries PRIVATE renderdoc)
if(APPLE)
list(APPEND sources renderdoccmd_apple.cpp)
elseif(ANDROID)
list(APPEND sources renderdoccmd_android.cpp)
include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
list(APPEND libraries PRIVATE -llog -landroid)
elseif(UNIX)
list(APPEND sources renderdoccmd_linux.cpp)
if(ENABLE_GL)
add_definitions(-DRENDERDOC_SUPPORT_GL)
find_package(OpenGL REQUIRED)
list(APPEND includes PRIVATE ${OPENGL_INCLUDE_DIR})
list(APPEND libraries PRIVATE ${OPENGL_gl_LIBRARY})
endif()
if(ENABLE_XLIB)
list(APPEND libraries PRIVATE -lX11)
endif()
if(ENABLE_XCB)
list(APPEND libraries PRIVATE -lxcb)
endif()
if(ENABLE_XLIB AND ENABLE_XCB)
list(APPEND libraries PRIVATE -lX11-xcb)
endif()
endif()
if(ANDROID)
add_library(renderdoccmd SHARED ${sources})
else()
add_executable(renderdoccmd ${sources})
endif()
target_include_directories(renderdoccmd ${includes})
target_link_libraries(renderdoccmd ${libraries})
install (TARGETS renderdoccmd DESTINATION bin)