+# For EGL headers
+include_directories (${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/khr)
+
+##############################################################################
+# Installation directories
+
+if (WIN32 OR APPLE)
+ # On Windows/MacOSX, applications are usually installed on a directory of
+ # their own
+ set (DOC_INSTALL_DIR doc)
+else ()
+ set (DOC_INSTALL_DIR share/doc/${CMAKE_PROJECT_NAME})
+endif ()
+
+set (LIB_INSTALL_DIR lib/apitrace)
+
+if (APPLE)
+ # MacOSX uses fat binaries, so no need to have per-architecture wrapper
+ # directories
+ set (LIB_ARCH_INSTALL_DIR ${LIB_INSTALL_DIR})
+else ()
+ set (LIB_ARCH_INSTALL_DIR ${LIB_INSTALL_DIR}/${CMAKE_SYSTEM_PROCESSOR})
+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_WRAPPER_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}"
+)
+