CMakeLists.txt 1.41 KB
Newer Older
1 2
set(BUILD_opencv_cnn_3dobj_INIT OFF)  # Must be disabled by default - requires custom build of Caffe.

3 4 5 6 7 8 9 10 11 12
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR})

find_package(Caffe)
if(Caffe_FOUND)
  message(STATUS "Caffe:   YES")
  set(HAVE_CAFFE 1)
else()
  message(STATUS "Caffe:   NO")
endif()

13 14 15
if(NOT BUILD_PROTOBUF)
  find_package(Protobuf)
endif()
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
if(Protobuf_FOUND)
  message(STATUS "Protobuf:   YES")
  set(HAVE_PROTOBUF 1)
else()
  message(STATUS "Protobuf:   NO")
endif()

find_package(Glog)
if(Glog_FOUND)
  message(STATUS "Glog:   YES")
  set(HAVE_GLOG 1)
else()
  message(STATUS "Glog:   NO")
endif()

31 32 33
if(NOT HAVE_CAFFE)
    ocv_module_disable(cnn_3dobj)
else()
34 35 36

include_directories(${CMAKE_CURRENT_BINARY_DIR})

37
include_directories(${Caffe_INCLUDE_DIR})
38
set(the_description "CNN for 3D object recognition and pose estimation including a completed Sphere View on 3D objects")
39
ocv_define_module(cnn_3dobj opencv_core opencv_imgproc ${Caffe_LIBS} ${Glog_LIBS} ${Protobuf_LIBS} OPTIONAL opencv_features2d opencv_viz opencv_calib3d WRAP python)
40
ocv_add_testdata(testdata/cv contrib/cnn_3dobj)
41

42
if(TARGET opencv_test_cnn_3dobj)
43
  target_link_libraries(opencv_test_cnn_3dobj PUBLIC boost_system)
44
endif()
45

46
foreach(exe_TGT  classify video sphereview_data model_analysis)
47
    if(TARGET example_cnn_3dobj_${exe_TGT})
48
      target_link_libraries(example_cnn_3dobj_${exe_TGT} PUBLIC boost_system)
49 50
    endif()
endforeach()
51
endif()