From 7f53a6bf8fc20694ba714e3dede5f2a617f04669 Mon Sep 17 00:00:00 2001
From: Mathieu Faverge <mathieu.faverge@inria.fr>
Date: Sat, 29 Jul 2017 00:46:21 +0200
Subject: [PATCH] Fix header install

---
 include/CMakeLists.txt | 53 ++++++++++++++----------------------------
 1 file changed, 18 insertions(+), 35 deletions(-)

diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 21457aa53..bcbfb84fa 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -3,8 +3,8 @@
 # @copyright (c) 2009-2014 The University of Tennessee and The University
 #                          of Tennessee Research Foundation.
 #                          All rights reserved.
-# @copyright (c) 2012-2017 Inria. All rights reserved.
-# @copyright (c) 2012-2014 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria, Univ. Bordeaux. All rights reserved.
+# @copyright (c) 2012-2017 Bordeaux INP, CNRS (LaBRI UMR 5800), Inria,
+#                          Univ. Bordeaux. All rights reserved.
 #
 ###
 #
@@ -27,7 +27,6 @@
 #
 ###
 
-
 # Generate the morse headers for all possible precisions
 # ------------------------------------------------------
 set(CHAMELEON_HDRS_GENERATED "")
@@ -49,45 +48,29 @@ configure_file("chameleon/chameleon_config.h.in"
 # Define the list of headers
 # --------------------------
 set(CHAMELEON_HDRS
-    chameleon/chameleon_config.h
-    chameleon/morse_constants.h
-    chameleon/morse_kernels.h
-    chameleon/morse_mangling.h
-    chameleon/morse_runtime.h
-    chameleon/morse_simulate.h
-    chameleon/morse_struct.h
-    chameleon/morse_tasks.h
-    chameleon/morse_types.h
-    ${CHAMELEON_HDRS_GENERATED}
-    )
+  ${CMAKE_CURRENT_BINARY_DIR}/chameleon/chameleon_config.h
+  ${CMAKE_CURRENT_BINARY_DIR}/chameleon/morse_mangling.h
+  chameleon/morse_constants.h
+  chameleon/morse_kernels.h
+  chameleon/morse_runtime.h
+  chameleon/morse_simulate.h
+  chameleon/morse_struct.h
+  chameleon/morse_tasks.h
+  chameleon/morse_types.h
+  )
 
-# set(flags_to_add "")
-# foreach(_prec ${CHAMELEON_PRECISION})
-#     set(flags_to_add "${flags_to_add} -DPRECISION_${_prec}")
-# endforeach()
-# set_source_files_properties(runtime.h PROPERTIES COMPILE_FLAGS "${flags_to_add}")
+# Add generated headers
+# ---------------------
+foreach( hdr_file ${CHAMELEON_HDRS_GENERATED} )
+  list(APPEND CHAMELEON_HDRS ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
+endforeach()
 
 # Force generation of headers
 # ---------------------------
 add_custom_target(chameleon_include
   ALL SOURCES morse.h ${CHAMELEON_HDRS} )
 
-# set(HDR_INSTALL
-#     chameleon/chameleon_config.h
-#     chameleon/morse_constants.h
-#     chameleon/morse_kernels.h
-#     chameleon/morse_simulate.h
-#     chameleon/morse_struct.h
-#     chameleon/morse_types.h
-#     chameleon/morse_mangling.h
-#     chameleon/runtime.h
-#     ${CHAMELEON_HDRS_GENERATED}
-#     )
-# foreach( hdr_file ${CHAMELEON_HDRS_GENERATED} )
-#     list(APPEND HDR_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/${hdr_file})
-# endforeach()
-
-# installation
+# Installation
 # ------------
 install( FILES morse.h
          DESTINATION include )
-- 
GitLab