summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ca72832)
Previously, we've had code to carefully find wrappers and scripts
relative to an apitrace binary being run from an uninstalled
directory. This is extremely useful while testing an experimental
feature before installing said experimental code.
Similarly, provide a findProgram function to do the same thing for an
executable program and use it within "apitrace dump-images" when
invoking glretrace.
add_definitions(
-DAPITRACE_BINARY_DIR="${CMAKE_BINARY_DIR}"
-DAPITRACE_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}"
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}"
)
-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 "os_string.hpp"
#include "os_process.hpp"
+#include "trace_resource.hpp"
+
static const char *synopsis = "Dump frame images obtained from a trace.";
static void
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;
* 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");
command.push_back("-s");
command.push_back(output);
command.push_back("-S");
+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)
{
os::String
findWrapper(const char *wrapperFilename)
{
+os::String
+findProgram(const char*programFilename);
+
os::String
findScript(const char *name);
os::String
findScript(const char *name);