From 589c2da3227dddab7fa370403a427ab24d53ad1a Mon Sep 17 00:00:00 2001
From: fherrero <fherrero@iri.upc.edu>
Date: Wed, 13 May 2020 12:51:47 +0200
Subject: [PATCH] Update Find cmake with correct paths and path order

---
 Findbattery_monitor.cmake | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Findbattery_monitor.cmake b/Findbattery_monitor.cmake
index 1d21de3..a7bf0c5 100755
--- a/Findbattery_monitor.cmake
+++ b/Findbattery_monitor.cmake
@@ -1,10 +1,12 @@
-#edit the following line to add the librarie's header files
 SET(name battery_monitor)
-FIND_PATH(${name}_INCLUDE_DIRS ${name}.h /usr/include/iri/${name} /usr/local/include/iri/${name})
+#edit the following line to add the librarie's header files
+SET(header_files ${name}.h)
+
+FIND_PATH(${name}_INCLUDE_DIRS ${header_files}.h /usr/local/include/iri/${name} /usr/include/iri/${name})
 
 FIND_LIBRARY(${name}_LIBRARIES
     NAMES ${name}
-    PATHS /usr/lib /usr/lib/iri/${name} /usr/local/lib /usr/local/lib/iri/${name})
+    PATHS /usr/local/lib/iri/${name} /usr/lib/iri/${name})
     
 SET(${name}_INCLUDE_DIR ${${name}_INCLUDE_DIRS})
 SET(${name}_LIBRARY     ${${name}_LIBRARIES})
@@ -21,4 +23,4 @@ ELSE (${name}_FOUND)
    IF (${name}_FIND_REQUIRED)
       MESSAGE(FATAL_ERROR "Could not find ${name}")
    ENDIF (${name}_FIND_REQUIRED)
-ENDIF (${name}_FOUND)
+ENDIF (${name}_FOUND)
\ No newline at end of file
-- 
GitLab