]> git.cworth.org Git - apitrace/blobdiff - CMakeLists.txt
Link against X11 libraries.
[apitrace] / CMakeLists.txt
index f6802e39be791adb04b018a2155253f95c71087d..8fb356e9aaf60c75cf97141fb1cec25f7ae2e443 100644 (file)
@@ -24,6 +24,7 @@ if (NOT WIN32)
     # to deploy the wrappers DLLs
     find_package (ZLIB)
     find_package (PNG)
+    find_package (X11 REQUIRED)
 else (NOT WIN32)
     find_package (DirectX)
 endif (NOT WIN32)
@@ -177,6 +178,7 @@ if (WIN32)
     endif (MINGW)
 
 else ()
+    include_directories (${X11_INCLUDE_DIR})
 
     # libGL.so
     add_custom_command (
@@ -186,10 +188,6 @@ else ()
     )
 
     add_library (glxtrace SHARED glxtrace.cpp trace_write.cpp os_posix.cpp ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp)
-    set_target_properties (glxtrace PROPERTIES 
-        COMPILER_DEFINITIONS "-DRETRACE"
-        PREFIX ""
-    )
     target_link_libraries (glxtrace dl)
 endif ()
 
@@ -231,14 +229,23 @@ add_executable (glretrace
     ${CMAKE_CURRENT_BINARY_DIR}/glproc.hpp
 )
 
+set_property (
+    TARGET glretrace
+    APPEND
+    PROPERTY COMPILE_DEFINITIONS "RETRACE"
+)
+
 target_link_libraries (glretrace
     trace
     ${OPENGL_gl_LIBRARY}
     ${OPENGL_glu_LIBRARY}
+    ${X11_LIBRARIES}
 )
 
+if (NOT WIN32)
+    target_link_libraries (glretrace ${X11_LIBRARIES})
+endif (NOT WIN32)
+
 if (QT4_FOUND AND QJSON_FOUND)
-    # Include the cmake file needed to use qt4
-    include( ${QT_USE_FILE} )
     add_subdirectory(gui)
 endif (QT4_FOUND AND QJSON_FOUND)