[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60924] trunk/blender: add check for cmake that source files are not included multiple times

Campbell Barton ideasman42 at gmail.com
Fri Oct 25 08:21:38 CEST 2013


Revision: 60924
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60924
Author:   campbellbarton
Date:     2013-10-25 06:21:38 +0000 (Fri, 25 Oct 2013)
Log Message:
-----------
add check for cmake that source files are not included multiple times

Modified Paths:
--------------
    trunk/blender/build_files/cmake/macros.cmake
    trunk/blender/source/blender/render/CMakeLists.txt

Modified: trunk/blender/build_files/cmake/macros.cmake
===================================================================
--- trunk/blender/build_files/cmake/macros.cmake	2013-10-25 06:14:33 UTC (rev 60923)
+++ trunk/blender/build_files/cmake/macros.cmake	2013-10-25 06:21:38 UTC (rev 60924)
@@ -48,6 +48,24 @@
 	unset(_index)
 endmacro()
 
+function (list_assert_duplicates
+	list_id
+	)
+	
+	# message(STATUS "list data: ${list_id}")
+
+	list(LENGTH list_id _len_before)
+	list(REMOVE_DUPLICATES list_id)
+	list(LENGTH list_id _len_after)
+	# message(STATUS "list size ${_len_before} -> ${_len_after}")
+	if(NOT _len_before EQUAL _len_after)
+		message(FATAL_ERROR "duplicate found in list which should not contain duplicates: ${list_id}")
+	endif()
+	unset(_len_before)
+	unset(_len_after)
+endfunction()
+
+
 # foo_bar.spam --> foo_barMySuffix.spam
 macro(file_suffix
 	file_name_new file_name file_suffix
@@ -177,6 +195,11 @@
 	# listed is helpful for IDE's (QtCreator/MSVC)
 	blender_source_group("${sources}")
 
+	list_assert_duplicates("${sources}")
+	list_assert_duplicates("${includes}")
+	# Not for system includes because they can resolve to the same path
+	# list_assert_duplicates("${includes_sys}")
+
 endmacro()
 
 

Modified: trunk/blender/source/blender/render/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/render/CMakeLists.txt	2013-10-25 06:14:33 UTC (rev 60923)
+++ trunk/blender/source/blender/render/CMakeLists.txt	2013-10-25 06:21:38 UTC (rev 60924)
@@ -98,7 +98,6 @@
 	intern/include/raycounter.h
 	intern/include/rayobject.h
 	intern/include/rayintersection.h
-	intern/include/raycounter.h
 	intern/include/render_types.h
 	intern/include/render_result.h
 	intern/include/rendercore.h




More information about the Bf-blender-cvs mailing list