Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2013-11-23 20:17:12 +0400
committerSergej Reich <sergej.reich@googlemail.com>2013-11-23 20:17:12 +0400
commit39dc956f593b3406bf1d81fb83c557b7b51f5327 (patch)
tree50b59815aad48902a6563aefc8b944daf34c401e /build_files/cmake/macros.cmake
parent5d5176095e82b34499e15d74f1fb76d56f4d9508 (diff)
parentd846c9a3b75c3d6f20bc7ab7d2da6cdd18bbbef2 (diff)
Merge branch 'master' into soc-2013-rigid_body_simsoc-2013-rigid_body_sim
Conflicts: intern/rigidbody/CMakeLists.txt release/datafiles/splash.png source/blender/editors/space_view3d/drawobject.c source/blender/makesdna/DNA_view3d_types.h
Diffstat (limited to 'build_files/cmake/macros.cmake')
-rw-r--r--build_files/cmake/macros.cmake51
1 files changed, 51 insertions, 0 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 9ded803f45b..e7e88ad5703 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -48,6 +48,24 @@ macro(list_insert_before
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 @@ macro(blender_add_lib_nolist
# 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()
@@ -847,3 +870,31 @@ macro(svg_to_png
unset(_file_to)
endmacro()
+
+macro(msgfmt_simple
+ file_from
+ list_to_add)
+
+ # remove ../'s
+ get_filename_component(_file_from_we ${file_from} NAME_WE)
+
+ get_filename_component(_file_from ${file_from} REALPATH)
+ get_filename_component(_file_to ${CMAKE_CURRENT_BINARY_DIR}/${_file_from_we}.mo REALPATH)
+
+ list(APPEND ${list_to_add} ${_file_to})
+
+ get_filename_component(_file_to_path ${_file_to} PATH)
+
+ add_custom_command(
+ OUTPUT ${_file_to}
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${_file_to_path}
+ COMMAND ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/msgfmt ${_file_from} ${_file_to}
+ DEPENDS msgfmt)
+
+ set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE)
+
+ unset(_file_from_we)
+ unset(_file_from)
+ unset(_file_to)
+ unset(_file_to_path)
+endmacro()