gentoo-overlay/dev-util/apitrace/files/apitrace-2.0-glxtrace-only.patch

89 lines
2.5 KiB
Diff

--- apitrace-apitrace-e2c4320/CMakeLists.txt.orig
+++ apitrace-apitrace-e2c4320/CMakeLists.txt
@@ -17,6 +17,7 @@
# prescribed in http://www.gentoo.org/proj/en/qa/automagic.xml
set (ENABLE_GUI "AUTO" CACHE STRING "Enable Qt GUI.")
+option (BUILD_LIB_ONLY "Build the glxtrace library only" OFF)
##############################################################################
# Find dependencies
@@ -141,7 +142,13 @@
include_directories (${ZLIB_INCLUDE_DIRS})
link_libraries (${ZLIB_LIBRARIES})
-find_package (SNAPPY REQUIRED)
+if (BUILD_LIB_ONLY)
+ set (SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy)
+ set (SNAPPY_LIBRARIES snappy_bundled)
+ add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL)
+else (BUILD_LIB_ONLY)
+ find_package (SNAPPY REQUIRED)
+endif (BUILD_LIB_ONLY)
include_directories (${SNAPPY_INCLUDE_DIRS})
link_libraries (${SNAPPY_LIBRARIES})
@@ -158,6 +165,8 @@
# By bundling the QJSON source, we make it much more easier to build the GUI on
# Windows and MacOSX. But we only use the bundled sources when ENABLE_GUI is
# AUTO.
+if (NOT BUILD_LIB_ONLY)
+
if (QT4_FOUND AND NOT QJSON_FOUND AND (ENABLE_GUI STREQUAL "AUTO"))
add_subdirectory (thirdparty/qjson EXCLUDE_FROM_ALL)
set (QJSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/qjson)
@@ -166,6 +175,8 @@
set (QJSON_FOUND TRUE)
endif ()
+endif (NOT BUILD_LIB_ONLY)
+
# For glext headers
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
@@ -215,9 +226,12 @@
link_libraries (common)
+if (NOT BUILD_LIB_ONLY)
+
add_executable (tracedump tracedump.cpp)
install (TARGETS tracedump RUNTIME DESTINATION bin)
+endif (NOT BUILD_LIB_ONLY)
##############################################################################
# API tracers
@@ -374,6 +388,8 @@
##############################################################################
# API retracers
+if (NOT BUILD_LIB_ONLY)
+
add_custom_command (
OUTPUT glretrace_gl.cpp
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/glretrace.py > ${CMAKE_CURRENT_BINARY_DIR}/glretrace_gl.cpp
@@ -386,11 +402,15 @@
DEPENDS glstate.py specs/glparams.py specs/gltypes.py specs/stdapi.py
)
+endif (NOT BUILD_LIB_ONLY)
+
include_directories (
${CMAKE_CURRENT_BINARY_DIR}
${OPENGL_INCLUDE_PATH}
)
+if (NOT BUILD_LIB_ONLY)
+
add_executable (glretrace
glretrace_gl.cpp
glretrace_cgl.cpp
@@ -438,6 +458,7 @@
add_subdirectory(gui)
endif ()
+endif (NOT BUILD_LIB_ONLY)
##############################################################################
# Packaging