CMake: fix building without libmv
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Apr 2019 12:10:38 +0000 (14:10 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Apr 2019 12:11:17 +0000 (14:11 +0200)
extern/ceres/CMakeLists.txt
extern/glog/CMakeLists.txt
intern/libmv/CMakeLists.txt
intern/libmv/bundle.sh

index 7653bc4..d91e64b 100644 (file)
@@ -257,9 +257,14 @@ set(SRC
 )
 
 set(LIB
-       extern_glog
 )
 
+if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
+       list(APPEND LIB
+               extern_glog
+       )
+endif()
+
 if(WITH_LIBMV_SCHUR_SPECIALIZATIONS)
        list(APPEND SRC
                internal/ceres/generated/partitioned_matrix_view_2_2_2.cc
index 47c5063..05a6590 100644 (file)
@@ -54,9 +54,14 @@ set(SRC
 )
 
 set(LIB
-       extern_gflags
 )
 
+if(NOT WITH_SYSTEM_GFLAGS)
+       list(APPEND LIB
+               extern_gflags
+       )
+endif()
+
 if(WIN32)
        list(APPEND SRC
                src/windows/port.cc
index b2193ae..67bf0de 100644 (file)
@@ -34,8 +34,7 @@ set(SRC
 )
 
 set(LIB
-       extern_ceres
-       extern_glog
+
 )
 
 if(WITH_LIBMV)
@@ -58,6 +57,11 @@ if(WITH_LIBMV)
                ${ZLIB_INCLUDE_DIRS}
        )
 
+       list(APPEND LIB
+               extern_ceres
+               extern_glog
+       )
+
        add_definitions(
                -DWITH_LIBMV_GUARDED_ALLOC
                -DLIBMV_NO_FAST_DETECTOR=
index ca7f22a..0c28a1c 100755 (executable)
@@ -113,8 +113,7 @@ set(SRC
 )
 
 set(LIB
-       extern_ceres
-       extern_glog
+
 )
 
 if(WITH_LIBMV)
@@ -137,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=