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}"
)
#include "os_string.hpp"
#include "os_process.hpp"
+#include "trace_resource.hpp"
+
static const char *synopsis = "Dump frame images obtained from a trace.";
static void
* already been pulled in for the "apitrace retrace" (or "apitrace
* replay") command. */
std::vector<const char *> command;
- command.push_back("glretrace");
+
+ os::String glretracePath = trace::findProgram("glretrace");
+ command.push_back(glretracePath);
command.push_back("-s");
command.push_back(output);
command.push_back("-S");
namespace trace {
+os::String
+findProgram(const char*programFilename)
+{
+ os::String programPath;
+
+ os::String processDir = os::getProcessName();
+ processDir.trimFilename();
+
+ programPath = processDir;
+ programPath.join(programFilename);
+ if (programPath.exists()) {
+ return programPath;
+ }
+
+#ifndef _WIN32
+ // Try absolute install directory
+ programPath = APITRACE_PROGRAMS_INSTALL_DIR;
+ programPath.join(programFilename);
+ if (programPath.exists()) {
+ return programPath;
+ }
+#endif
+
+ return "";
+}
+
os::String
findWrapper(const char *wrapperFilename)
{
namespace trace {
+os::String
+findProgram(const char*programFilename);
+
os::String
findScript(const char *name);