From eec5b4b551f51f8aad29b50d847137e7cb608002 Mon Sep 17 00:00:00 2001
From: Joaquim Casals <jcasals@iri.upc.edu>
Date: Tue, 14 May 2019 14:23:53 +0200
Subject: [PATCH] Added Config file for GNSS plugin

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

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3039a1a0d..614e52d2d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -84,6 +84,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)
 
@@ -123,7 +124,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}")
@@ -144,7 +145,6 @@ include_directories("${PROJECT_BINARY_DIR}/conf")
 INCLUDE_DIRECTORIES(${EIGEN_INCLUDE_DIRS})
 INCLUDE_DIRECTORIES(${wolf_INCLUDE_DIRS})
 include_directories(BEFORE "include")
-include_directories(.)
 INCLUDE_DIRECTORIES(${laser_scan_utils_INCLUDE_DIRS})
 IF(Ceres_FOUND)
     INCLUDE_DIRECTORIES(${CERES_INCLUDE_DIRS})
@@ -322,7 +322,7 @@ FILE(WRITE ${PROJECT_NAME}.found "")
 INSTALL(FILES ${PROJECT_NAME}.found
   DESTINATION include/iri-algorithms/wolf/plugin_${PROJECT_NAME})
 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}")
 
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_ */
-- 
GitLab