From 120eb3ff46ce7b4ac421cb0fe436e7069d186a1e Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Fri, 15 Mar 2019 09:00:10 +0200
Subject: [PATCH] Update CMake hopefully to work on windows

---
 cv-node/CMakeLists.txt | 6 ++++--
 cv-node/src/main.cpp   | 8 ++++----
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/cv-node/CMakeLists.txt b/cv-node/CMakeLists.txt
index 8c4ec948b..728e9e30c 100644
--- a/cv-node/CMakeLists.txt
+++ b/cv-node/CMakeLists.txt
@@ -29,7 +29,8 @@ set(FTL_VERSION "${ftl_VERSION_MAJOR}.${ftl_VERSION_MINOR}.${ftl_VERSION_PATCH}"
 add_definitions(-DFTL_VERSION=${FTL_VERSION})
 
 if (WIN32)
-	set(FTL_CONFIG_ROOT "$ENV{USERPROFILE}/AppData/ftl")
+	set(FTL_CONFIG_ROOT "\"$ENV{USERPROFILE}/AppData/ftl\"")
+	message(STATUS "Config root is ${FTL_CONFIG_ROOT}")
 	set(FTL_CACHE_ROOT "$ENV{USERPROFILE}/AppData/ftl")
 	set(FTL_DATA_ROOT "$ENV{USERPROFILE}/AppData/ftl")
 	add_definitions(-DWIN32)
@@ -38,11 +39,12 @@ endif (WIN32)
 if (UNIX)
 	add_definitions(-DUNIX)
 	set(FTL_CONFIG_ROOT "\"$ENV{HOME}/.config/ftl\"")
+	message(STATUS "Config root is ${FTL_CONFIG_ROOT}")
 	set(FTL_CACHE_ROOT "$ENV{HOME}/.cache/ftl")
 	set(FTL_DATA_ROOT "$ENV{HOME}/.local/share/ftl")
 endif (UNIX)
 
-add_definitions(-DFTL_CONFIG_ROOT=${FTL_CONFIG_ROOT})
+add_definitions("-DFTL_CONFIG_ROOT=${FTL_CONFIG_ROOT}")
 add_definitions(-DFTL_CACHE_ROOT=${FTL_CACHE_ROOT})
 add_definitions(-DFTL_DATA_ROOT=${FTL_DATA_ROOT})
 
diff --git a/cv-node/src/main.cpp b/cv-node/src/main.cpp
index 1d20dbe0d..7da43575a 100644
--- a/cv-node/src/main.cpp
+++ b/cv-node/src/main.cpp
@@ -101,7 +101,7 @@ int main(int argc, char **argv) {
 		LOG(WARNING) << "Cameras are not calibrated!";
 	}
 
-	int max_disp = 208; //256;
+	int max_disp = 256; //208;
 	int wsize = 5;
 	float sigma = 1.5;
 	float lambda = 8000.0;
@@ -137,8 +137,8 @@ int main(int argc, char **argv) {
 		// TODO Pose and disparity etc here...
 		
 		// Downscale to half
-		cv::resize(l, l, cv::Size(l.cols * 0.75,l.rows * 0.75), 0, 0, INTER_LINEAR);
-		cv::resize(r, r, cv::Size(r.cols * 0.75,r.rows * 0.75), 0, 0, INTER_LINEAR);
+		//cv::resize(l, l, cv::Size(l.cols * 0.75,l.rows * 0.75), 0, 0, INTER_LINEAR);
+		//cv::resize(r, r, cv::Size(r.cols * 0.75,r.rows * 0.75), 0, 0, INTER_LINEAR);
 		
         cvtColor(l,  l,  COLOR_BGR2GRAY);
         cvtColor(r, r, COLOR_BGR2GRAY);
@@ -161,7 +161,7 @@ int main(int argc, char **argv) {
 		cv::imshow("Left",filtered_disp);
 		//if (lsrc->isStereo()) cv::imshow("Right",right_disp);
 		
-		if(cv::waitKey(20) == 27){
+		if(cv::waitKey(1) == 27){
             //exit if ESC is pressed
             break;
         }
-- 
GitLab