diff --git a/src/Wintel64/ProcessHiLites/ProcessHilites.cpp b/src/Wintel64/ProcessHiLites/ProcessHilites.cpp index b98d94a..68ded65 100644 --- a/src/Wintel64/ProcessHiLites/ProcessHilites.cpp +++ b/src/Wintel64/ProcessHiLites/ProcessHilites.cpp @@ -38,6 +38,11 @@ #define CVBlack 0,0,0 #define CVCyan 255,255,153 +#ifdef Linux +#include +#endif + + using namespace std; using namespace cv; @@ -51,6 +56,7 @@ int leftSide = 320; // These values are very specific to the setup used in prog int top = 120; // It woould be better to have these passed in as parameters from the trafficReports program. ********************** string inLine, lhs, rhs; + string dataPathPrefix; @@ -88,6 +94,13 @@ bool blackFrame(Mat inFrame){ int main(){ // Get data path prefix from ProcessHiLites.cfg +#ifdef Linux + // IMPROVE ME : does $HOME/VST/ProcessHilities.cfg exist ? + // if it does: use it + // if not existing : use default environment values + dataPathPrefix = (string)secure_getenv("HOME") + DIR_SEP + "VST"; + cout << "dataPathPrefix = " << dataPathPrefix << endl; +#endif string lhsString[23] = { "dataPathPrefix", "CropLeft", @@ -118,10 +131,12 @@ int main(){ while (1){ getchar(); } } switch (lineNo){ +#ifndef Linux case 0: dataPathPrefix = rhs; cout << "dataPathPrefix = " << dataPathPrefix << endl; break; +#endif case 1: leftSide = stoi(rhs); cout << "leftSide = " << leftSide << endl; diff --git a/src/Wintel64/common/make.rules b/src/Wintel64/common/make.rules index 3160c2c..890e014 100644 --- a/src/Wintel64/common/make.rules +++ b/src/Wintel64/common/make.rules @@ -1,19 +1,23 @@ -CXXFLAGS = -Wall -Werror -g -LDLIBS = -lopencv_core -lopencv_highgui -lopencv_imgproc ifeq ($(shell uname),Darwin) +LDLIBS = -lopencv_core -lopencv_highgui -lopencv_imgproc # Go get opencv3: # brew install homebrew/science/opencv3 # Here's where that lands: CPPFLAGS = -I/usr/local/opt/opencv3/include LDFLAGS = -L/usr/local/opt/opencv3/lib LDLIBS += -lopencv_videoio +DEBUG_FLAGS = -g endif ifeq ($(shell uname),Linux) +OS_EXTRA_FLAGS = -DLinux +LDLIBS = `pkg-config --cflags --libs opencv` CPPFLAGS = -I/usr/include/opencv +#DEBUG_FLAGS = -g endif +CXXFLAGS = -Wall -Werror ${DEBUG_FLAGS} ${OS_EXTRA_FLAGS} # clang and g++ require c++11 for in-class const initialization CXXFLAGS += -std=c++11