CMake: fix building without libmv
[blender.git] / intern / libmv / bundle.sh
index 27e012f..0c28a1c 100755 (executable)
@@ -95,10 +95,6 @@ cat > CMakeLists.txt << EOF
 #
 # The Original Code is Copyright (C) 2011, Blender Foundation
 # All rights reserved.
-#
-# Contributor(s): Blender Foundation,
-#                 Sergey Sharybin
-#
 # ***** END GPL LICENSE BLOCK *****
 
 # NOTE: This file is automatically generated by bundle.sh script
@@ -116,14 +112,19 @@ set(SRC
        libmv-capi.h
 )
 
+set(LIB
+
+)
+
 if(WITH_LIBMV)
        add_definitions(\${GFLAGS_DEFINES})
        add_definitions(\${GLOG_DEFINES})
        add_definitions(\${CERES_DEFINES})
+       add_definitions(-DLIBMV_GFLAGS_NAMESPACE=\${GFLAGS_NAMESPACE})
 
        list(APPEND INC
                \${GFLAGS_INCLUDE_DIRS}
-               ../../extern/glog/src
+               \${GLOG_INCLUDE_DIRS}
                ../../extern/ceres/include
                ../../extern/ceres/config
                ../guardedalloc
@@ -135,6 +136,11 @@ if(WITH_LIBMV)
                \${ZLIB_INCLUDE_DIRS}
        )
 
+       list(APPEND LIB
+               extern_ceres
+               extern_glog
+       )
+
        add_definitions(
                -DWITH_LIBMV_GUARDED_ALLOC
                -DLIBMV_NO_FAST_DETECTOR=
@@ -173,7 +179,7 @@ ${third_headers}
 
 
        if(WITH_GTESTS)
-               blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "${INC}" "${INC_SYS}")
+               blender_add_lib(libmv_test_dataset "./libmv/multiview/test_data_sets.cc" "${INC}" "${INC_SYS}" "")
 
 ${tests}
        endif()
@@ -183,5 +189,5 @@ else()
        )
 endif()
 
-blender_add_lib(bf_intern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}")
+blender_add_lib(bf_intern_libmv "\${SRC}" "\${INC}" "\${INC_SYS}" "\${LIB}")
 EOF