From fb990824a1b5489d9438956c41be2b3c3fde85f5 Mon Sep 17 00:00:00 2001
From: Romain Forlot <romain.forlot@iot.bzh>
Date: Thu, 24 Aug 2017 18:05:10 +0200
Subject: Workaround to bugged list filter backport function

Change-Id: I520bcb09add89567083f0c06bde92dae08206c50
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
---
 cmake/cmake.d/03-macros.cmake | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

(limited to 'cmake')

diff --git a/cmake/cmake.d/03-macros.cmake b/cmake/cmake.d/03-macros.cmake
index ff4388d..db31884 100644
--- a/cmake/cmake.d/03-macros.cmake
+++ b/cmake/cmake.d/03-macros.cmake
@@ -132,17 +132,24 @@ endmacro(add_required_module)
 
 # Create custom target dedicated for HTML5 and DATA AGL target type
 macro(add_input_files INPUT_FILES)
-	set(XML_LIST ${INPUT_FILES})
-	set(LUA_LIST ${INPUT_FILES})
-	set(JSON_LIST ${INPUT_FILES})
+	if(NOT DEFINED XML_FILES)
+		set(XML_LIST ${INPUT_FILES})
+		list_filter(XML_LIST "xml$")
+	endif()
+	if(NOT DEFINED LUA_FILES)
+		set(LUA_LIST ${INPUT_FILES})
+		list_filter(LUA_LIST "lua$")
+	endif()
+	if(NOT DEFINED JSON_FILES)
+		set(JSON_LIST ${INPUT_FILES})
+		list_filter(JSON_LIST "json$")
+	endif()
+
 	# These are v3.6 subcommand. Not used as default for now as
 	# many dev use Ubuntu 16.04 which have only 3.5 version
 	#list(FILTER XML_LIST INCLUDE REGEX "xml$")
 	#list(FILTER LUA_LIST INCLUDE REGEX "lua$")
 	#list(FILTER JSON_LIST INCLUDE REGEX "json$")
-	list_filter(XML_LIST "xml$")
-	list_filter(LUA_LIST "lua$")
-	list_filter(JSON_LIST "json$")
 
 	add_custom_target(${TARGET_NAME}
 	DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
-- 
cgit 1.2.3-korg