From db750b984332fc303f5d69364045cf1fd3a044e6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 16 Jun 2014 13:21:33 +0600 Subject: Add missing dependency to CMake's msgfmt This could have lead to situation when CMake wouldn't re-generate .mo file from changed .po file. --- build_files/cmake/macros.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build_files/cmake') diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index 772ff6d7596..bdd38837604 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -1006,7 +1006,7 @@ macro(msgfmt_simple 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) + DEPENDS msgfmt ${_file_from}) set_source_files_properties(${_file_to} PROPERTIES GENERATED TRUE) -- cgit v1.2.3 From 0125ae1eb24f3cf9e9ad57c3be65f939ed88b338 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 16 Jun 2014 15:13:01 +0600 Subject: Forgot this in previous commit --- build_files/cmake/buildinfo.cmake | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'build_files/cmake') diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake index c1d21c413dc..31b1cffc3f6 100644 --- a/build_files/cmake/buildinfo.cmake +++ b/build_files/cmake/buildinfo.cmake @@ -85,6 +85,10 @@ if(EXISTS ${SOURCE_DIR}/.git) endif() endif() + if(MY_WC_BRANCH MATCHES "^blender-") + set(MY_WC_BRANCH "master") + endif() + unset(_git_below_check) endif() -- cgit v1.2.3 From 38d684168759382dac015ead3e768dc015bb817c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 16 Jun 2014 15:16:18 +0600 Subject: Need to consider blender-v* a release branch, not just blender- This is because of blender-tiles branch we've got.. --- build_files/cmake/buildinfo.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build_files/cmake') diff --git a/build_files/cmake/buildinfo.cmake b/build_files/cmake/buildinfo.cmake index 31b1cffc3f6..3660b3e5f2e 100644 --- a/build_files/cmake/buildinfo.cmake +++ b/build_files/cmake/buildinfo.cmake @@ -85,7 +85,7 @@ if(EXISTS ${SOURCE_DIR}/.git) endif() endif() - if(MY_WC_BRANCH MATCHES "^blender-") + if(MY_WC_BRANCH MATCHES "^blender-v") set(MY_WC_BRANCH "master") endif() -- cgit v1.2.3 From 306cbb82ecf0d7c1ba4fb0a1240175b1976bd25b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 18 Jun 2014 22:49:17 +1000 Subject: GTest unit testing framework Currently covers only small set of functionality. --- build_files/cmake/Modules/GTestTesting.cmake | 47 ++++++ build_files/cmake/macros.cmake | 234 +++++++++++++++++++++++++++ 2 files changed, 281 insertions(+) create mode 100644 build_files/cmake/Modules/GTestTesting.cmake (limited to 'build_files/cmake') diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake new file mode 100644 index 00000000000..c039a1e1760 --- /dev/null +++ b/build_files/cmake/Modules/GTestTesting.cmake @@ -0,0 +1,47 @@ +#============================================================================= +# Copyright 2014 Blender Foundation. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +# +# Inspired on the Testing.cmake from Libmv +# +#============================================================================= + +macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS) + if(WITH_TESTS) + get_property(_current_include_directories + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + PROPERTY INCLUDE_DIRECTORIES) + set(TEST_INC + ${_current_include_directories} + ${CMAKE_SOURCE_DIR}/tests/gtests + ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/glog/src + ${CMAKE_SOURCE_DIR}/extern/libmv/third_party/gflags + ${CMAKE_SOURCE_DIR}/extern/gtest/include + ) + unset(_current_include_directories) + + add_executable(${NAME}_test ${SRC}) + target_link_libraries(${NAME}_test + ${EXTRA_LIBS} + bf_testing_main + bf_intern_guardedalloc + extern_gtest + extern_glog) + set_target_properties(${NAME}_test PROPERTIES + RUNTIME_OUTPUT_DIRECTORY "${TESTS_OUTPUT_DIR}" + RUNTIME_OUTPUT_DIRECTORY_RELEASE "${TESTS_OUTPUT_DIR}" + RUNTIME_OUTPUT_DIRECTORY_DEBUG "${TESTS_OUTPUT_DIR}" + INCLUDE_DIRECTORIES "${TEST_INC}") + add_test(${NAME}_test ${TESTS_OUTPUT_DIR}/${NAME}_test) + endif() +endmacro() + +macro(BLENDER_TEST NAME EXTRA_LIBS) + BLENDER_SRC_GTEST("${NAME}" "${NAME}_test.cc" "${EXTRA_LIBS}") +endmacro() diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index bdd38837604..f8720f0761d 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -413,6 +413,240 @@ macro(setup_liblinks target_link_libraries(${target} ${PLATFORM_LINKLIBS} ${CMAKE_DL_LIBS}) endmacro() +macro(SETUP_BLENDER_SORTED_LIBS) + get_property(BLENDER_LINK_LIBS GLOBAL PROPERTY BLENDER_LINK_LIBS) + + list(APPEND BLENDER_LINK_LIBS + bf_windowmanager + bf_render + ) + + if(WITH_MOD_FLUID) + list(APPEND BLENDER_LINK_LIBS bf_intern_elbeem) + endif() + + if(WITH_CYCLES) + list(APPEND BLENDER_LINK_LIBS + cycles_render + cycles_bvh + cycles_device + cycles_kernel + cycles_util + cycles_subd) + if(WITH_CYCLES_OSL) + list(APPEND BLENDER_LINK_LIBS cycles_kernel_osl) + endif() + endif() + + # Sort libraries + set(BLENDER_SORTED_LIBS + bf_windowmanager + + bf_editor_space_api + bf_editor_space_action + bf_editor_space_buttons + bf_editor_space_console + bf_editor_space_file + bf_editor_space_graph + bf_editor_space_image + bf_editor_space_info + bf_editor_space_logic + bf_editor_space_nla + bf_editor_space_node + bf_editor_space_outliner + bf_editor_space_script + bf_editor_space_sequencer + bf_editor_space_text + bf_editor_space_time + bf_editor_space_userpref + bf_editor_space_view3d + bf_editor_space_clip + + bf_editor_transform + bf_editor_util + bf_editor_uvedit + bf_editor_curve + bf_editor_gpencil + bf_editor_interface + bf_editor_mesh + bf_editor_metaball + bf_editor_object + bf_editor_armature + bf_editor_physics + bf_editor_render + bf_editor_screen + bf_editor_sculpt_paint + bf_editor_sound + bf_editor_animation + bf_editor_datafiles + bf_editor_mask + bf_editor_io + + bf_render + bf_python + bf_python_ext + bf_python_mathutils + bf_python_bmesh + bf_freestyle + bf_ikplugin + bf_modifiers + bf_bmesh + bf_blenkernel + bf_nodes + bf_gpu + bf_blenloader + bf_imbuf + bf_blenlib + bf_intern_ghost + bf_intern_string + bf_avi + bf_imbuf_cineon + bf_imbuf_openexr + bf_imbuf_openimageio + bf_imbuf_dds + bf_collada + bf_intern_elbeem + bf_intern_memutil + bf_intern_guardedalloc + bf_intern_ctr + bf_intern_utfconv + ge_blen_routines + ge_converter + ge_phys_dummy + ge_phys_bullet + bf_intern_smoke + extern_minilzo + extern_lzma + extern_colamd + ge_logic_ketsji + extern_recastnavigation + ge_logic + ge_rasterizer + ge_oglrasterizer + ge_logic_expressions + ge_scenegraph + ge_logic_network + ge_logic_ngnetwork + ge_logic_loopbacknetwork + bf_intern_moto + extern_openjpeg + extern_redcode + ge_videotex + bf_rna + bf_dna + bf_blenfont + bf_intern_audaspace + bf_intern_mikktspace + bf_intern_dualcon + bf_intern_cycles + cycles_render + cycles_bvh + cycles_device + cycles_kernel + cycles_util + cycles_subd + bf_intern_raskter + bf_intern_opencolorio + extern_rangetree + extern_wcwidth + extern_libmv + extern_glog + ) + + if(WITH_COMPOSITOR) + # added for opencl compositor + list_insert_before(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_compositor") + list_insert_after(BLENDER_SORTED_LIBS "bf_compositor" "bf_intern_opencl") + endif() + + if(WITH_LIBMV) + list(APPEND BLENDER_SORTED_LIBS extern_ceres) + endif() + + if(WITH_MOD_CLOTH_ELTOPO) + list(APPEND BLENDER_SORTED_LIBS extern_eltopo) + endif() + + if(NOT WITH_SYSTEM_GLEW) + list(APPEND BLENDER_SORTED_LIBS extern_glew) + endif() + + if(WITH_BINRELOC) + list(APPEND BLENDER_SORTED_LIBS extern_binreloc) + endif() + + if(WITH_CXX_GUARDEDALLOC) + list(APPEND BLENDER_SORTED_LIBS bf_intern_guardedalloc_cpp) + endif() + + if(WITH_IK_SOLVER) + list_insert_after(BLENDER_SORTED_LIBS "bf_intern_elbeem" "bf_intern_iksolver") + endif() + + if(WITH_IK_ITASC) + list(APPEND BLENDER_SORTED_LIBS bf_intern_itasc) + endif() + + if(WITH_CODEC_QUICKTIME) + list(APPEND BLENDER_SORTED_LIBS bf_quicktime) + endif() + + if(WITH_INPUT_NDOF) + list(APPEND BLENDER_SORTED_LIBS bf_intern_ghostndof3dconnexion) + endif() + + if(WITH_MOD_BOOLEAN) + list(APPEND BLENDER_SORTED_LIBS extern_carve) + endif() + + if(WITH_GHOST_XDND) + list(APPEND BLENDER_SORTED_LIBS extern_xdnd) + endif() + + if(WITH_CYCLES_OSL) + list_insert_after(BLENDER_SORTED_LIBS "cycles_kernel" "cycles_kernel_osl") + endif() + + if(WITH_INTERNATIONAL) + list(APPEND BLENDER_SORTED_LIBS bf_intern_locale) + endif() + + if(WITH_OPENNL) + list_insert_after(BLENDER_SORTED_LIBS "bf_render" "bf_intern_opennl") + endif() + + if(WITH_BULLET) + list_insert_after(BLENDER_SORTED_LIBS "bf_blenkernel" "bf_intern_rigidbody") + endif() + + if(WITH_BULLET AND NOT WITH_SYSTEM_BULLET) + list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet") + endif() + + foreach(SORTLIB ${BLENDER_SORTED_LIBS}) + set(REMLIB ${SORTLIB}) + foreach(SEARCHLIB ${BLENDER_LINK_LIBS}) + if(${SEARCHLIB} STREQUAL ${SORTLIB}) + set(REMLIB "") + endif() + endforeach() + if(REMLIB) + # message(STATUS "Removing library ${REMLIB} from blender linking because: not configured") + list(APPEND REM_MSG ${REMLIB}) + list(REMOVE_ITEM BLENDER_SORTED_LIBS ${REMLIB}) + endif() + endforeach() + if(REM_MSG) + list(SORT REM_MSG) + message(STATUS "Blender Skipping: (${REM_MSG})") + endif() + + unset(SEARCHLIB) + unset(SORTLIB) + unset(REMLIB) + unset(REM_MSG) +endmacro() + macro(TEST_SSE_SUPPORT _sse_flags _sse2_flags) -- cgit v1.2.3 From 72b607ab7428d7900acc52e6b40dbd579a72241c Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 18 Jun 2014 22:28:27 +0600 Subject: Some WITH_TESTS weer not renamed to WITH_GTEST --- build_files/cmake/Modules/GTestTesting.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'build_files/cmake') diff --git a/build_files/cmake/Modules/GTestTesting.cmake b/build_files/cmake/Modules/GTestTesting.cmake index c039a1e1760..fd0379b8f78 100644 --- a/build_files/cmake/Modules/GTestTesting.cmake +++ b/build_files/cmake/Modules/GTestTesting.cmake @@ -13,7 +13,7 @@ #============================================================================= macro(BLENDER_SRC_GTEST NAME SRC EXTRA_LIBS) - if(WITH_TESTS) + if(WITH_GTESTS) get_property(_current_include_directories DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES) -- cgit v1.2.3 From eaac6cbcd9428533273091710759106131f92340 Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Thu, 19 Jun 2014 11:49:09 -0400 Subject: Add a bmesh_core_test, a start at testing bmesh functionality. Needed to make the blender link libraries a global property now that tests are parallel to source directory. Current sort order for blender link libraries doesn't work for tests that start with few defined symbols. Doubling the lib list works, but a TODO to find a better way (probably using CMake's own mechanism for tracking dependencies). --- build_files/cmake/macros.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'build_files/cmake') diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake index f8720f0761d..c6caef4d3d1 100644 --- a/build_files/cmake/macros.cmake +++ b/build_files/cmake/macros.cmake @@ -645,6 +645,9 @@ macro(SETUP_BLENDER_SORTED_LIBS) unset(SORTLIB) unset(REMLIB) unset(REM_MSG) + + # for top-level tests + set_property(GLOBAL PROPERTY BLENDER_SORTED_LIBS_PROP ${BLENDER_SORTED_LIBS}) endmacro() macro(TEST_SSE_SUPPORT -- cgit v1.2.3