From 1b934d69204beb297e2b3fc9ad379644760bf2a5 Mon Sep 17 00:00:00 2001
From: Guilhem Saurel <guilhem.saurel@laas.fr>
Date: Mon, 13 Jan 2020 12:58:54 +0100
Subject: [PATCH] [CMake] put headers in library definition

---
 CMakeLists.txt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f56a8e8..3fcc8b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -76,8 +76,7 @@ ENDIF (NOT (\"${CMAKE_VERBOSITY_LEVEL}\" STREQUAL \"\"))
 #include_directories(${Boost_INCLUDE_DIRS})
 #link_directories(${Boost_LIBRARY_DIRS})
 
-ADD_LIBRARY(${LIBRARY_NAME}
-  SHARED
+SET(${PROJECT_NAME}_SOURCES
   src/debug/debug.cpp
   src/debug/real-time-logger.cpp
   src/debug/logger.cpp
@@ -154,6 +153,9 @@ SET(${PROJECT_NAME}_HEADERS
   include/dynamic-graph/logger.h
 )
 
+ADD_LIBRARY(${LIBRARY_NAME}
+  SHARED ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_HEADERS})
+
 SET(PUBLIC_HEADER ${${PROJECT_NAME}_HEADERS})
 
 INSTALL(TARGETS ${PROJECT_NAME}
-- 
GitLab