summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorLaurent Carlier <lordheavym@gmail.com>2014-08-03 03:06:08 +0200
committerJosé Fonseca <jfonseca@vmware.com>2014-08-26 21:40:44 +0100
commit89e27ebd8cc1de13040d38f54b763dbf42d23135 (patch)
treef074628f597067c7746427d608f05867f2c0aa26 /cli
parent193c5b27148f44e3960fa5484c149866f4e9fe65 (diff)
cli: prefer detected python executable instead of harcoded one
In ArchLinux, python means python3 v2: Don't change Windows behavior -- Jose.
Diffstat (limited to 'cli')
-rw-r--r--cli/CMakeLists.txt5
-rw-r--r--cli/cli_diff.cpp4
-rw-r--r--cli/cli_diff_images.cpp4
-rw-r--r--cli/cli_diff_state.cpp4
4 files changed, 11 insertions, 6 deletions
diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt
index f1b71c1c..ae5fa85c 100644
--- a/cli/CMakeLists.txt
+++ b/cli/CMakeLists.txt
@@ -8,6 +8,11 @@ add_definitions(
-DAPITRACE_SCRIPTS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${SCRIPTS_INSTALL_DIR}"
-DAPITRACE_WRAPPERS_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}/${WRAPPER_INSTALL_DIR}"
)
+if (WIN32)
+ add_definitions (-DAPITRACE_PYTHON_EXECUTABLE="python")
+else ()
+ add_definitions (-DAPITRACE_PYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}")
+endif ()
add_executable (apitrace
cli_main.cpp
diff --git a/cli/cli_diff.cpp b/cli/cli_diff.cpp
index 6aec76fd..daeccd3e 100644
--- a/cli/cli_diff.cpp
+++ b/cli/cli_diff.cpp
@@ -47,7 +47,7 @@ usage(void)
os::String command = find_command();
char *args[4];
- args[0] = (char *) "python";
+ args[0] = (char *) APITRACE_PYTHON_EXECUTABLE;
args[1] = (char *) command.str();
args[2] = (char *) "--help";
args[3] = NULL;
@@ -65,7 +65,7 @@ command(int argc, char *argv[])
os::String apitracePath = os::getProcessName();
std::vector<const char *> args;
- args.push_back("python");
+ args.push_back(APITRACE_PYTHON_EXECUTABLE);
args.push_back(command.str());
args.push_back("--apitrace");
args.push_back(apitracePath.str());
diff --git a/cli/cli_diff_images.cpp b/cli/cli_diff_images.cpp
index 87678bf0..54523cd3 100644
--- a/cli/cli_diff_images.cpp
+++ b/cli/cli_diff_images.cpp
@@ -47,7 +47,7 @@ usage(void)
os::String command = find_command();
char *args[4];
- args[0] = (char *) "python";
+ args[0] = (char *) APITRACE_PYTHON_EXECUTABLE;
args[1] = (char *) command.str();
args[2] = (char *) "--help";
args[3] = NULL;
@@ -63,7 +63,7 @@ command(int argc, char *argv[])
os::String command = find_command();
std::vector<const char *> args;
- args.push_back("python");
+ args.push_back(APITRACE_PYTHON_EXECUTABLE);
args.push_back(command.str());
for (i = 1; i < argc; i++) {
args.push_back(argv[i]);
diff --git a/cli/cli_diff_state.cpp b/cli/cli_diff_state.cpp
index 952efa98..0488e77f 100644
--- a/cli/cli_diff_state.cpp
+++ b/cli/cli_diff_state.cpp
@@ -47,7 +47,7 @@ usage(void)
os::String command = find_command();
char *args[4];
- args[0] = (char *) "python";
+ args[0] = (char *) APITRACE_PYTHON_EXECUTABLE;
args[1] = (char *) command.str();
args[2] = (char *) "--help";
args[3] = NULL;
@@ -63,7 +63,7 @@ command(int argc, char *argv[])
os::String command = find_command();
std::vector<const char *> args;
- args.push_back("python");
+ args.push_back(APITRACE_PYTHON_EXECUTABLE);
args.push_back(command.str());
for (i = 1; i < argc; i++) {
args.push_back(argv[i]);