From 2bc0ca46a72059e15cccd112473464aca1399720 Mon Sep 17 00:00:00 2001
From: Joaquim Casals <jcasals@iri.upc.edu>
Date: Tue, 14 May 2019 14:23:18 +0200
Subject: [PATCH] Added Config file for IMU plugin & fixed gtest include

---
 CMakeLists.txt                         | 6 +++---
 internal/config.h.in                   | 6 +++---
 test/gtest_processor_IMU_jacobians.cpp | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 668d5997b..e242f5b0b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -85,6 +85,7 @@ set(BUILD_TESTS true)
 # but for the examples ?
 # yes, for the tests !
 IF(BUILD_EXAMPLES OR BUILD_TESTS)
+  string(TOUPPER ${PROJECT_NAME} UPPER_NAME)
   set(_WOLF_ROOT_DIR ${CMAKE_SOURCE_DIR})
 ENDIF(BUILD_EXAMPLES OR BUILD_TESTS)
 
@@ -125,7 +126,7 @@ ELSE (Suitesparse_INCLUDE_DIRS)
 ENDIF (Suitesparse_INCLUDE_DIRS)
 
 # Define the directory where will be the configured config.h
-SET(WOLF_CONFIG_DIR ${PROJECT_BINARY_DIR}/conf/internal)
+SET(WOLF_CONFIG_DIR ${PROJECT_BINARY_DIR}/conf/${PROJECT_NAME}/internal)
 
 # Create the specified output directory if it does not exist.
 IF(NOT EXISTS "${WOLF_CONFIG_DIR}")
@@ -146,7 +147,6 @@ include_directories("${PROJECT_BINARY_DIR}/conf")
 INCLUDE_DIRECTORIES(${EIGEN_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(${wolf_INCLUDE_DIRS})
 include_directories(BEFORE "include")
-include_directories(.)
 IF(Ceres_FOUND)
     INCLUDE_DIRECTORIES(${CERES_INCLUDE_DIRS})
 ENDIF(Ceres_FOUND)
@@ -336,7 +336,7 @@ INSTALL(FILES ${PROJECT_NAME}.found
 FILE(WRITE IMU.found "")
 
 INSTALL(FILES "${WOLF_CONFIG_DIR}/config.h"
-DESTINATION include/iri-algorithms/wolf/internal)
+  DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME}/${PROJECT_NAME}/internal)
 
 INSTALL(FILES "${CMAKE_SOURCE_DIR}/cmake_modules/${PLUGIN_NAME}Config.cmake" DESTINATION "lib/cmake/${PLUGIN_NAME}")
 INSTALL(DIRECTORY ${SPDLOG_INCLUDE_DIRS} DESTINATION "include/iri-algorithms/")
diff --git a/internal/config.h.in b/internal/config.h.in
index 7c0fe4756..b9008e196 100644
--- a/internal/config.h.in
+++ b/internal/config.h.in
@@ -24,13 +24,13 @@
 //            which will be added to the include path for compilation,
 //            and installed with the public wolf headers.
 
-#ifndef WOLF_INTERNAL_CONFIG_H_
-#define WOLF_INTERNAL_CONFIG_H_
+#ifndef WOLF_INTERNAL_${UPPERNAME}_CONFIG_H_
+#define WOLF_INTERNAL_${UPPERNAME}_CONFIG_H_
 
 #cmakedefine _WOLF_DEBUG
 
 #cmakedefine _WOLF_TRACE
 
-#define _WOLF_ROOT_DIR "${_WOLF_ROOT_DIR}"
+#define _WOLF_${UPPER_NAME}_ROOT_DIR "${_WOLF_ROOT_DIR}"
 
 #endif /* WOLF_INTERNAL_CONFIG_H_ */
diff --git a/test/gtest_processor_IMU_jacobians.cpp b/test/gtest_processor_IMU_jacobians.cpp
index f3c0cda67..369233724 100644
--- a/test/gtest_processor_IMU_jacobians.cpp
+++ b/test/gtest_processor_IMU_jacobians.cpp
@@ -8,7 +8,7 @@
  //Wolf
 #include "IMU/capture/capture_IMU.h"
 #include "IMU/sensor/sensor_IMU.h"
-#include "test/processor_IMU_UnitTester.h"
+#include "processor_IMU_UnitTester.h"
 #include "core/common/wolf.h"
 #include "core/problem/problem.h"
 #include "core/state_block/state_block.h"
-- 
GitLab