]> git.cworth.org Git - apitrace/commitdiff
Merge branch 'directxtex'
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 6 Mar 2013 11:46:41 +0000 (11:46 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 6 Mar 2013 11:46:41 +0000 (11:46 +0000)
1  2 
CMakeLists.txt
retrace/CMakeLists.txt

diff --combined CMakeLists.txt
index 90bfc870aade3941c9ab3a5c769e9873010f550a,46514aaf31934c2e1f53ff8c9e05f88f60d9bff4..3b932e1459cc3aa41300e849b1e335af83a38d09
@@@ -106,8 -106,8 +106,8 @@@ else (WIN32
  endif ()
  
  if (MSVC)
 -    # C99 includes for msvc
 -    include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/msvc)
 +    # C99 includes for MSVC
 +    include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/msinttypes)
  
      # Enable math constants defines
      add_definitions (-D_USE_MATH_DEFINES)
@@@ -181,42 -181,6 +181,42 @@@ endif (
  set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
  
  
 +##############################################################################
 +# Installation directories
 +
 +if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 +    # Debian multiarch support
 +    execute_process(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
 +        OUTPUT_VARIABLE ARCH_SUBDIR
 +        ERROR_QUIET
 +        OUTPUT_STRIP_TRAILING_WHITESPACE
 +    )
 +    CHECK_INCLUDE_FILES(proc/readproc.h READPROC_H_FOUND)
 +    if (READPROC_H_FOUND)
 +        add_definitions (-DHAVE_READPROC_H)
 +    endif ()
 +endif()
 +
 +if (WIN32 OR APPLE)
 +    # On Windows/MacOSX, applications are usually installed on a directory of
 +    # their own
 +    set (DOC_INSTALL_DIR doc)
 +    set (LIB_INSTALL_DIR lib)
 +    set (LIB_ARCH_INSTALL_DIR lib)
 +else ()
 +    set (DOC_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME})
 +    set (LIB_INSTALL_DIR lib/${CMAKE_PROJECT_NAME})
 +    if (ARCH_SUBDIR)
 +        set (LIB_ARCH_INSTALL_DIR lib/${ARCH_SUBDIR}/${CMAKE_PROJECT_NAME})
 +    else ()
 +        set (LIB_ARCH_INSTALL_DIR lib/${CMAKE_PROJECT_NAME})
 +    endif ()
 +endif ()
 +
 +set (SCRIPTS_INSTALL_DIR ${LIB_INSTALL_DIR}/scripts)
 +set (WRAPPER_INSTALL_DIR ${LIB_ARCH_INSTALL_DIR}/wrappers)
 +
 +
  ##############################################################################
  # Bundled dependencies
  #
  
  set (ZLIB_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/zlib)
  set (ZLIB_LIBRARIES z_bundled)
 -add_subdirectory (thirdparty/zlib EXCLUDE_FROM_ALL)
 +add_subdirectory (thirdparty/zlib)
  
  include_directories (${ZLIB_INCLUDE_DIRS})
  
  set (SNAPPY_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/snappy)
  set (SNAPPY_LIBRARIES snappy_bundled)
 -add_subdirectory (thirdparty/snappy EXCLUDE_FROM_ALL)
 +add_subdirectory (thirdparty/snappy)
  
  include_directories (${SNAPPY_INCLUDE_DIRS})
  
@@@ -241,16 -205,17 +241,17 @@@ set (PNG_INCLUDE_DIR ${CMAKE_CURRENT_SO
  set (PNG_DEFINITIONS "")
  set (PNG_LIBRARIES png_bundled)
  
 -add_subdirectory (thirdparty/libpng EXCLUDE_FROM_ALL)
 +add_subdirectory (thirdparty/libpng)
  
  if (MSVC)
 -    add_subdirectory (thirdparty/getopt EXCLUDE_FROM_ALL)
 +    add_subdirectory (thirdparty/getopt)
      include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/getopt)
      set (GETOPT_LIBRARIES getopt_bundled)
  endif ()
  
  if (WIN32)
      add_subdirectory (thirdparty/less)
+     add_subdirectory (thirdparty/directxtex)
  endif ()
  
  # Always use bundled QJSon.
  # binaries at all.
  if (QT4_FOUND)
      add_definitions (-DQJSON_EXPORT=)
 -    add_subdirectory (thirdparty/qjson EXCLUDE_FROM_ALL)
 +    add_subdirectory (thirdparty/qjson)
      set (QJSON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty)
      set (QJSON_LIBRARY_DIRS)
      set (QJSON_LIBRARIES qjson_bundled)
@@@ -273,6 -238,51 +274,6 @@@ endif (
  include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khronos)
  
  
 -##############################################################################
 -# Installation directories
 -
 -if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
 -    # Debian multiarch support
 -    execute_process(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH
 -        OUTPUT_VARIABLE ARCH_SUBDIR
 -        ERROR_QUIET
 -        OUTPUT_STRIP_TRAILING_WHITESPACE
 -    )
 -endif()
 -
 -if (WIN32 OR APPLE)
 -    # On Windows/MacOSX, applications are usually installed on a directory of
 -    # their own
 -    set (DOC_INSTALL_DIR doc)
 -    set (LIB_INSTALL_DIR lib)
 -    set (LIB_ARCH_INSTALL_DIR lib)
 -else ()
 -    set (DOC_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME})
 -    set (LIB_INSTALL_DIR lib/${CMAKE_PROJECT_NAME})
 -    if (ARCH_SUBDIR)
 -        set (LIB_ARCH_INSTALL_DIR lib/${ARCH_SUBDIR}/${CMAKE_PROJECT_NAME})
 -    else ()
 -        set (LIB_ARCH_INSTALL_DIR lib/${CMAKE_PROJECT_NAME})
 -    endif ()
 -endif ()
 -
 -set (SCRIPTS_INSTALL_DIR ${LIB_INSTALL_DIR}/scripts)
 -set (WRAPPER_INSTALL_DIR ${LIB_ARCH_INSTALL_DIR}/wrappers)
 -
 -# Expose the binary/install directories to source
 -#
 -# TODO: Use the same directory layout, for both build and install directories,
 -# so that binaries can find each other using just relative paths.
 -#
 -add_definitions(
 -    -DAPITRACE_BINARY_DIR="${CMAKE_BINARY_DIR}"
 -    -DAPITRACE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
 -    -DAPITRACE_PROGRAMS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/bin"
 -    -DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}"
 -    -DAPITRACE_WRAPPERS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}"
 -)
 -
 -
  ##############################################################################
  # Common libraries / utilities
  
@@@ -352,22 -362,11 +353,22 @@@ endif (
  
  install (
      PROGRAMS
 -        ${CMAKE_CURRENT_SOURCE_DIR}/scripts/tracediff.py
 -        ${CMAKE_CURRENT_SOURCE_DIR}/scripts/jsondiff.py
 -        ${CMAKE_CURRENT_SOURCE_DIR}/scripts/snapdiff.py
 +        scripts/highlight.py
 +        scripts/jsondiff.py
 +        scripts/profileshader.py
 +        scripts/retracediff.py
 +        scripts/snapdiff.py
 +        scripts/tracecheck.py
 +        scripts/tracediff.py
 +        scripts/unpickle.py
      DESTINATION ${SCRIPTS_INSTALL_DIR}
  )
 +if (WIN32)
 +    install (
 +        PROGRAMS scripts/convert.py
 +        DESTINATION ${SCRIPTS_INSTALL_DIR}
 +    )
 +endif ()
  
  ##############################################################################
  # GUI
@@@ -383,22 -382,11 +384,22 @@@ endif (
  install (
      FILES
          BUGS.markdown
 -        LICENSE
          NEWS.markdown
          README.markdown
      DESTINATION ${DOC_INSTALL_DIR}
  )
 +install (
 +    FILES LICENSE
 +    DESTINATION ${DOC_INSTALL_DIR}
 +    RENAME LICENSE.txt
 +)
 +if (MSVC)
 +    install (
 +        FILES thirdparty/msinttypes/LICENSE
 +        DESTINATION ${DOC_INSTALL_DIR}
 +        RENAME LICENSE-msinttypes.txt
 +    )
 +endif ()
  
  set (CPACK_PACKAGE_VERSION_MAJOR "3")
  set (CPACK_PACKAGE_VERSION_MINOR "0")
diff --combined retrace/CMakeLists.txt
index 9ea1ae9998e68587f67c43498ded0790b9769657,26659908ba9bd0bc46a57f6788beb6d5b0e67c87..5f831a4ef0045d2dff8a8cb090c0964485f9ea03
@@@ -102,9 -102,6 +102,9 @@@ if (WIN32 OR APPLE OR X11_FOUND
  
          if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
              target_link_libraries (glretrace rt)
 +            if (READPROC_H_FOUND)
 +                target_link_libraries (glretrace proc)
 +            endif ()
          endif ()
  
      endif ()
@@@ -130,9 -127,6 +130,9 @@@ if (ENABLE_EGL AND X11_FOUND AND NOT WI
  
      if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
          target_link_libraries (eglretrace rt)
 +        if (READPROC_H_FOUND)
 +            target_link_libraries (eglretrace proc)
 +        endif ()
      endif ()
  
      install (TARGETS eglretrace RUNTIME DESTINATION bin) 
@@@ -142,10 -136,6 +142,10 @@@ if (WIN32
      if (DirectX_D3D8_INCLUDE_DIR) 
          include_directories (BEFORE SYSTEM ${DirectX_D3D8_INCLUDE_DIR})
          set (HAVE_D3D8 1)
 +        set (D3DSTATE_SOURCES ${D3DSTATE_SOURCES}
 +            d3d8state.cpp
 +            d3d8state_images.cpp
 +        )
      else ()
          set (HAVE_D3D8 0)
      endif ()
      endif ()
  
      if (DirectX_D3D11_INCLUDE_DIR)
-         include_directories (BEFORE SYSTEM ${DirectX_D3D11_INCLUDE_DIR})
+         include_directories (BEFORE SYSTEM
+             ${DirectX_D3D11_INCLUDE_DIR}
+             ${CMAKE_SOURCE_DIR}/thirdparty/directxtex/DirectXTex
+         )
          set (DXGI_MODULES ${DXGI_MODULES} d3d11)
          if (DirectX_D3D11_1_INCLUDE_DIR)
              include_directories (BEFORE SYSTEM ${DirectX_D3D11_1_INCLUDE_DIR})
          retrace_common
          d3dhelpers
      )
+     if (DirectX_D3D11_INCLUDE_DIR)
+         target_link_libraries (d3dretrace directxtex)
+     endif ()
  
      install (TARGETS d3dretrace RUNTIME DESTINATION bin)
  endif ()