diff --git a/CMakeLists.txt b/CMakeLists.txt index 41ff3fc3..5000586b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,12 @@ include(cmake/RMVLVersion.cmake) set(para_template_path "${CMAKE_SOURCE_DIR}/cmake/templates" CACHE INTERNAL "GenPara template path" FORCE) include(cmake/RMVLGenPara.cmake) +# ---------------------------------------------------------------------------- +# RMVL 3rdparty libraries +# ---------------------------------------------------------------------------- +find_package(OpenCV REQUIRED) +find_package(Eigen3 REQUIRED) + # ---------------------------------------------------------------------------- # Process subdirectories # ---------------------------------------------------------------------------- @@ -94,7 +100,7 @@ endif(BUILD_EXAMPLES) # Documents generation # ---------------------------------------------------------------------------- if(BUILD_DOCS) - find_package(Doxygen) + find_package(Doxygen REQUIRED) if(DOXYGEN_FOUND) add_custom_target( doxygen @@ -163,15 +169,13 @@ endif() status(" ccache:" ENABLE_CCACHE AND CCACHE_FOUND THEN YES ELSE NO) # =================== Other third-party libraries =================== -find_package(OpenCV QUIET) -find_package(Eigen3 QUIET) status("") status(" Other third-party libraries:") status(" OpenCV: (*)" OpenCV_FOUND THEN "YES (ver ${OpenCV_VERSION})" ELSE NO) status(" Eigen library: (*)" Eigen3_FOUND THEN "YES (ver ${EIGEN3_VERSION_STRING})" ELSE NO) -status(" onnxruntime:" WITH_ONNXRUNTIME THEN YES ELSE NO) +status(" onnxruntime:" WITH_ONNXRUNTIME THEN "YES (ver ${Ort_VERSION})" ELSE NO) status(" apriltag:" WITH_APRILTAG THEN YES ELSE NO) -status(" open62541:" WITH_OPEN62541 THEN YES ELSE NO) +status(" open62541:" WITH_OPEN62541 THEN "YES (ver ${open62541_VERSION})" ELSE NO) # =============================== SDK =============================== status("") @@ -183,18 +187,35 @@ status(" OPT:" BUILD_rmvl_opt_camera THEN YES ELSE NO) status(" Light controller:") status(" OPT:" BUILD_rmvl_opt_light_control THEN YES ELSE NO) -# ===================== Inference engine in RMVL ==================== -status("") -status(" Inference engine in RMVL:") -status(" Ort:" BUILD_rmvl_ort THEN YES ELSE NO) - # ========================== RMVL modules =========================== -string(REGEX REPLACE "rmvl_" " " modules_public_dir ${RMVL_MODULES_PUBLIC}) -string(REGEX REPLACE "rmvl_" " " modules_interface_dir ${RMVL_MODULES_INTERFACE}) +set(RMVL_MAIN_MODULES_BUILD ${RMVL_MODULES_BUILD}) +foreach(m ${RMVL_EXTRA_MODULE}) + string(TOUPPER "${m}" mUP) + list(REMOVE_ITEM RMVL_MAIN_MODULES_BUILD ${RMVL_${mUP}_MODULES_BUILD} rmvl_types) + if("${m}" STREQUAL "types") + continue() + endif() + string(REGEX REPLACE "rmvl_" " " ${m}_modules ${RMVL_${mUP}_MODULES_BUILD}) +endforeach() +string(REGEX REPLACE "rmvl_" " " main_modules ${RMVL_MAIN_MODULES_BUILD}) + +status("") +status(" RMVL main modules:") +status(" To be built:" ${main_modules}) +status("") +status(" RMVL extra modules:" BUILD_EXTRA THEN YES ELSE NO) +if(BUILD_EXTRA) + status(" To be built:") + foreach(m ${RMVL_EXTRA_MODULE}) + if("${m}" STREQUAL "types") + continue() + endif() + status(" ${m}:" ${${m}_modules}) + endforeach() +endif() status("") -status(" RMVL modules:") -status(" public modules:" ${modules_public_dir}) -status(" interface modules:" ${modules_interface_dir}) +status(" Documents (Doxygen):" BUILD_DOCS THEN "YES (ver ${DOXYGEN_VERSION})" ELSE NO) + # ======================== Test and examples ======================== status("") diff --git a/cmake/FindOrt.cmake b/cmake/FindOrt.cmake index 5f2aa201..fbd7d99f 100755 --- a/cmake/FindOrt.cmake +++ b/cmake/FindOrt.cmake @@ -1,8 +1,13 @@ +# ------------------------------------------------------------------------------ +# find onnxruntime root path +# ------------------------------------------------------------------------------ if(NOT ort_root_path) set(ort_root_path "/usr/local") endif() -# add the include directories path +# ------------------------------------------------------------------------------ +# find onnxruntime include directory +# ------------------------------------------------------------------------------ find_path( Ort_INCLUDE_DIR PATHS "${ort_root_path}/include/onnxruntime" @@ -13,7 +18,9 @@ find_path( NO_DEFAULT_PATH ) -# add libraries +# ------------------------------------------------------------------------------ +# find onnxruntime library file +# ------------------------------------------------------------------------------ find_library( Ort_LIB NAMES "libonnxruntime.so" @@ -21,6 +28,9 @@ find_library( NO_DEFAULT_PATH ) +# ------------------------------------------------------------------------------ +# create imported target: onnxruntime +# ------------------------------------------------------------------------------ if(NOT TARGET onnxruntime) add_library(onnxruntime SHARED IMPORTED) set_target_properties(onnxruntime PROPERTIES @@ -31,12 +41,24 @@ endif() mark_as_advanced(Ort_INCLUDE_DIR Ort_LIB) +# ------------------------------------------------------------------------------ +# set onnxruntime cmake variables and version variables +# ------------------------------------------------------------------------------ set(Ort_LIBS "onnxruntime") set(Ort_INCLUDE_DIRS "${Ort_INCLUDE_DIR}") +file(STRINGS "${Ort_INCLUDE_DIR}/onnxruntime_c_api.h" Ort_VERSION + REGEX "#define ORT_API_VERSION [0-9]+" +) +string(REGEX REPLACE "#define ORT_API_VERSION ([0-9]+)" "1.\\1" Ort_VERSION "${Ort_VERSION}") + +# ------------------------------------------------------------------------------ +# handle the package +# ------------------------------------------------------------------------------ include(FindPackageHandleStandardArgs) find_package_handle_standard_args( Ort + VERSION_VAR Ort_VERSION REQUIRED_VARS Ort_LIB Ort_INCLUDE_DIR ) diff --git a/cmake/RMVLCompilerOptions.cmake b/cmake/RMVLCompilerOptions.cmake index 5a8460d2..1d484d53 100755 --- a/cmake/RMVLCompilerOptions.cmake +++ b/cmake/RMVLCompilerOptions.cmake @@ -220,12 +220,17 @@ option(BUILD_OPEN62541 "Build the 3rd party: open62541" OFF) if(BUILD_OPEN62541) add_subdirectory(${CMAKE_SOURCE_DIR}/3rdparty/open62541) endif() -find_package(open62541 QUIET) -if(BUILD_OPEN62541 OR open62541_FOUND) +if(BUILD_OPEN62541) + unset(WITH_OPEN62541 CACHE) option(WITH_OPEN62541 "Enable open62541 support" ON) else() - unset(WITH_OPEN62541 CACHE) - option(WITH_OPEN62541 "Enable open62541 support" OFF) + find_package(open62541 QUIET) + if(open62541_FOUND) + option(WITH_OPEN62541 "Enable open62541 support" ON) + else() + unset(WITH_OPEN62541 CACHE) + option(WITH_OPEN62541 "Enable open62541 support" OFF) + endif() endif() # onnxruntime diff --git a/cmake/RMVLModule.cmake b/cmake/RMVLModule.cmake index 35c35ffd..5c298379 100644 --- a/cmake/RMVLModule.cmake +++ b/cmake/RMVLModule.cmake @@ -6,15 +6,11 @@ # 全局变量 # # RMVL_MODULES_BUILD -# RMVL_MODULES_PUBLIC -# RMVL_MODULES_INTERFACE # # RMVL_MODULE_${the_module}_LOCATION # RMVL_MODULE_${the_module}_BINARY_DIR -set(RMVL_MODULES_BUILD "" CACHE INTERNAL "List of RMVL modules included into the build") -set(RMVL_MODULES_PUBLIC "" CACHE INTERNAL "List of RMVL public modules marked for export") -set(RMVL_MODULES_INTERFACE "" CACHE INTERNAL "List of RMVL interface modules marked for export") +set(RMVL_MODULES_BUILD "" CACHE INTERNAL "List of RMVL modules included into the build") # ---------------------------------------------------------------------------- # 将预处理定义添加至指定目标 @@ -70,7 +66,11 @@ function(rmvl_install_directories _dir) endfunction(rmvl_install_directories) # ---------------------------------------------------------------------------- -# 在当前目录中添加新的 RMVL 模块 +# 在当前目录中添加新的 RMVL 模块,并会依次添加至 +# - 局部变量 modules_build +# - 缓存变量 RMVL_MODULES_BUILD +# 中 +# # 用法: # rmvl_add_module( [INTERFACE] [EXTRA_HEADER ] # [EXTRA_SOURCE ] [DEPENDS ] @@ -190,12 +190,7 @@ macro(rmvl_add_module _name) ARCHIVE DESTINATION ${RMVL_LIB_INSTALL_PATH} LIBRARY DESTINATION ${RMVL_LIB_INSTALL_PATH} ) - - if(NOT MD_INTERFACE) # public library - set(RMVL_MODULES_PUBLIC ${RMVL_MODULES_PUBLIC} "${the_module}" CACHE INTERNAL "List of RMVL public modules marked for export" FORCE) - else() # interface library - set(RMVL_MODULES_INTERFACE ${RMVL_MODULES_INTERFACE} "${the_module}" CACHE INTERNAL "List of RMVL interface modules marked for export" FORCE) - endif(NOT MD_INTERFACE) + list(APPEND modules_build ${the_module}) set(RMVL_MODULES_BUILD ${RMVL_MODULES_BUILD} "${the_module}" CACHE INTERNAL "List of RMVL modules included into the build" FORCE) endif() unset(the_module) diff --git a/cmake/templates/RMVLConfig.cmake.in b/cmake/templates/RMVLConfig.cmake.in index 0b0eb5fc..baafa8e2 100644 --- a/cmake/templates/RMVLConfig.cmake.in +++ b/cmake/templates/RMVLConfig.cmake.in @@ -100,5 +100,5 @@ endforeach() # ============================================================= find_package_handle_standard_args(RMVL REQUIRED_VARS RMVL_INSTALL_PATH - VERSION_VAR RMVL_VERSION HANDLE_COMPONENTS + VERSION_VAR RMVL_VERSION ) diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt index 55a87b82..c70af352 100755 --- a/extra/CMakeLists.txt +++ b/extra/CMakeLists.txt @@ -4,16 +4,16 @@ file(GLOB module_extra_st RELATIVE "${cur_path}" "${cur_path}/*") set(RMVL_EXTRA_MODULE "") foreach(m ${module_extra_st}) - if(IS_DIRECTORY ${cur_path}/${m} AND (NOT (${m} STREQUAL include))) - list(APPEND RMVL_EXTRA_MODULE "${m}") - endif() + if(IS_DIRECTORY ${cur_path}/${m} AND (NOT (${m} STREQUAL include))) + list(APPEND RMVL_EXTRA_MODULE "${m}") + endif() endforeach() -set(RMVL_EXTRA_MODULE ${RMVL_EXTRA_MODULE} CACHE INTERNAL "List of main modules" FORCE) +set(RMVL_EXTRA_MODULE ${RMVL_EXTRA_MODULE} CACHE INTERNAL "List of main modules") # core modules foreach(m ${RMVL_EXTRA_MODULE}) - add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${m}) + add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/${m}) endforeach() unset(module_extra_st) diff --git a/extra/combo/CMakeLists.txt b/extra/combo/CMakeLists.txt index bee5a4dc..d23f29e2 100755 --- a/extra/combo/CMakeLists.txt +++ b/extra/combo/CMakeLists.txt @@ -1,3 +1,6 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for each combo +# ---------------------------------------------------------------------------- rmvl_add_module( combo DEPENDS feature camera @@ -25,7 +28,9 @@ rmvl_add_module( rmvl_generate_module_para(combo) -# build the test program +# ---------------------------------------------------------------------------- +# build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( combo Unit @@ -33,3 +38,8 @@ if(BUILD_TESTS) DEPEND_TESTS GTest::gtest_main ) endif(BUILD_TESTS) + +# ---------------------------------------------------------------------------- +# Export the combo modules +# ---------------------------------------------------------------------------- +set(RMVL_COMBO_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") \ No newline at end of file diff --git a/extra/compensator/CMakeLists.txt b/extra/compensator/CMakeLists.txt index 8ee70e20..342dfdc1 100755 --- a/extra/compensator/CMakeLists.txt +++ b/extra/compensator/CMakeLists.txt @@ -1,25 +1,26 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for each compensator +# ---------------------------------------------------------------------------- rmvl_add_module( compensator INTERFACE DEPENDS group ) +# gravity_compensator rmvl_generate_para( gravity_compensator MODULE compensator ) - -rmvl_generate_para( - gyro_compensator - MODULE compensator -) - -# gravity_compensator rmvl_add_module( gravity_compensator DEPENDS compensator ) # gyro_compensator +rmvl_generate_para( + gyro_compensator + MODULE compensator +) rmvl_add_module( gyro_compensator DEPENDS compensator gyro_group @@ -27,7 +28,9 @@ rmvl_add_module( rmvl_generate_module_para(compensator) -# Tests +# ---------------------------------------------------------------------------- +# Build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( compensator Unit @@ -35,3 +38,8 @@ if(BUILD_TESTS) DEPEND_TESTS GTest::gtest_main ) endif() + +# ---------------------------------------------------------------------------- +# Export the compensator modules +# ---------------------------------------------------------------------------- +set(RMVL_COMPENSATOR_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") diff --git a/extra/decider/CMakeLists.txt b/extra/decider/CMakeLists.txt index e694bd00..aa4f41fe 100755 --- a/extra/decider/CMakeLists.txt +++ b/extra/decider/CMakeLists.txt @@ -1,3 +1,6 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for each decider +# ---------------------------------------------------------------------------- rmvl_add_module( decider INTERFACE DEPENDS detector compensator predictor @@ -35,8 +38,15 @@ rmvl_add_module( rmvl_generate_module_para(decider) -# build the test program +# ---------------------------------------------------------------------------- +# Build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) endif(BUILD_TESTS) +# ---------------------------------------------------------------------------- +# Export the decider modules +# ---------------------------------------------------------------------------- +set(RMVL_DECIDER_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") + diff --git a/extra/detector/CMakeLists.txt b/extra/detector/CMakeLists.txt index d1acaa50..a306fd74 100755 --- a/extra/detector/CMakeLists.txt +++ b/extra/detector/CMakeLists.txt @@ -1,3 +1,6 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for each detector +# ---------------------------------------------------------------------------- rmvl_add_module( detector INTERFACE DEPENDS imgproc group @@ -50,7 +53,9 @@ endif() rmvl_generate_module_para(detector) -# build the test program +# ---------------------------------------------------------------------------- +# Build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( detector Unit @@ -58,3 +63,9 @@ if(BUILD_TESTS) DEPEND_TESTS GTest::gtest_main ) endif(BUILD_TESTS) + +# ---------------------------------------------------------------------------- +# Export the detector modules +# ---------------------------------------------------------------------------- +set(RMVL_DETECTOR_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") + diff --git a/extra/feature/CMakeLists.txt b/extra/feature/CMakeLists.txt index c55e0e8e..cce4cfa5 100755 --- a/extra/feature/CMakeLists.txt +++ b/extra/feature/CMakeLists.txt @@ -1,9 +1,10 @@ -find_package(OpenCV COMPONENTS imgproc calib3d REQUIRED) - +# ---------------------------------------------------------------------------- +# Generate para and add module for each feature +# ---------------------------------------------------------------------------- rmvl_add_module( feature INTERFACE DEPENDS types - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_imgproc opencv_calib3d ) # light_blob @@ -54,7 +55,9 @@ rmvl_add_module( rmvl_generate_module_para(feature) -# build the test program +# ---------------------------------------------------------------------------- +# build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( feature Unit @@ -62,3 +65,8 @@ if(BUILD_TESTS) DEPEND_TESTS GTest::gtest_main ) endif(BUILD_TESTS) + +# ---------------------------------------------------------------------------- +# Export the feature modules +# ---------------------------------------------------------------------------- +set(RMVL_FEATURE_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") diff --git a/extra/group/CMakeLists.txt b/extra/group/CMakeLists.txt index 7b3b859b..fb3db846 100755 --- a/extra/group/CMakeLists.txt +++ b/extra/group/CMakeLists.txt @@ -1,3 +1,6 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for each group +# ---------------------------------------------------------------------------- rmvl_add_module( group INTERFACE DEPENDS tracker @@ -25,7 +28,9 @@ rmvl_add_module( rmvl_generate_module_para(group) -# build the test program +# ---------------------------------------------------------------------------- +# Build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( group Unit @@ -33,3 +38,8 @@ if(BUILD_TESTS) DEPEND_TESTS GTest::gtest_main ) endif(BUILD_TESTS) + +# ---------------------------------------------------------------------------- +# Export the group modules +# ---------------------------------------------------------------------------- +set(RMVL_GROUP_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") diff --git a/extra/predictor/CMakeLists.txt b/extra/predictor/CMakeLists.txt index 84308b7e..c9d4fd23 100755 --- a/extra/predictor/CMakeLists.txt +++ b/extra/predictor/CMakeLists.txt @@ -1,3 +1,6 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for each predictor +# ---------------------------------------------------------------------------- rmvl_add_module( predictor INTERFACE DEPENDS group @@ -45,7 +48,9 @@ rmvl_add_module( rmvl_generate_module_para(predictor) -# build the test program +# ---------------------------------------------------------------------------- +# Build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( predictor Unit @@ -53,3 +58,8 @@ if(BUILD_TESTS) DEPEND_TESTS GTest::gtest_main ) endif(BUILD_TESTS) + +# ---------------------------------------------------------------------------- +# Export the predictor modules +# ---------------------------------------------------------------------------- +set(RMVL_PREDICTOR_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") diff --git a/extra/tracker/CMakeLists.txt b/extra/tracker/CMakeLists.txt index 49747d0b..cba52617 100755 --- a/extra/tracker/CMakeLists.txt +++ b/extra/tracker/CMakeLists.txt @@ -1,3 +1,6 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for each tracker +# ---------------------------------------------------------------------------- rmvl_add_module( tracker DEPENDS combo @@ -35,7 +38,9 @@ rmvl_add_module( rmvl_generate_module_para(tracker) -# build the test program +# ---------------------------------------------------------------------------- +# build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( tracker Unit @@ -43,3 +48,8 @@ if(BUILD_TESTS) DEPEND_TESTS GTest::gtest_main ) endif(BUILD_TESTS) + +# ---------------------------------------------------------------------------- +# Export the tracker modules +# ---------------------------------------------------------------------------- +set(RMVL_TRACKER_MODULES_BUILD ${modules_build} CACHE INTERNAL "modules to be built") diff --git a/extra/types/CMakeLists.txt b/extra/types/CMakeLists.txt index f67deb5c..12b07792 100644 --- a/extra/types/CMakeLists.txt +++ b/extra/types/CMakeLists.txt @@ -1,9 +1,14 @@ +# ---------------------------------------------------------------------------- +# Generate para and add module for types +# ---------------------------------------------------------------------------- rmvl_add_module( types DEPENDS core ) -# build the test program +# ---------------------------------------------------------------------------- +# Build the test program +# ---------------------------------------------------------------------------- if(BUILD_TESTS) rmvl_add_test( types Unit diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 67e4dacd..d37ea830 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -1,7 +1,3 @@ -find_package(Threads REQUIRED) -find_package(OpenCV COMPONENTS core REQUIRED) -find_package(Eigen3 REQUIRED) - # 生成预定义宏 rmvl_check_include_file( FILES termios.h dirent.h fcntl.h unistd.h @@ -15,7 +11,7 @@ rmvl_generate_para(core) rmvl_add_module( core EXTRA_HEADER ${EIGEN3_INCLUDE_DIR} - EXTERNAL ${CMAKE_THREAD_LIBS_INIT} opencv_core + EXTERNAL opencv_core ) # 添加预定义宏到 core 模块 diff --git a/modules/imgproc/CMakeLists.txt b/modules/imgproc/CMakeLists.txt index 85283db3..cf1aeeb0 100644 --- a/modules/imgproc/CMakeLists.txt +++ b/modules/imgproc/CMakeLists.txt @@ -1,9 +1,7 @@ -find_package(OpenCV REQUIRED) - rmvl_add_module( imgproc DEPENDS core - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_imgproc ) # Build the test program diff --git a/modules/ml/CMakeLists.txt b/modules/ml/CMakeLists.txt index e33e74b3..74b79f3b 100644 --- a/modules/ml/CMakeLists.txt +++ b/modules/ml/CMakeLists.txt @@ -1,9 +1,6 @@ -find_package(OpenCV REQUIRED) - rmvl_add_module( ml INTERFACE DEPENDS core - EXTERNAL ${OpenCV_LIBS} ) # add module: ort diff --git a/samples/camera/hik/CMakeLists.txt b/samples/camera/hik/CMakeLists.txt index 4329c475..fbdad7cd 100644 --- a/samples/camera/hik/CMakeLists.txt +++ b/samples/camera/hik/CMakeLists.txt @@ -2,32 +2,30 @@ if(NOT BUILD_rmvl_hik_camera) return() endif() -find_package(OpenCV COMPONENTS highgui calib3d REQUIRED) - rmvl_add_exe( rmvl_hik_mono SOURCES sample_hik_mono.cpp DEPENDS hik_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) rmvl_add_exe( rmvl_hik_multi SOURCES sample_hik_multi.cpp DEPENDS hik_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) rmvl_add_exe( rmvl_hik_writer SOURCES sample_hik_writer.cpp DEPENDS hik_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) rmvl_add_exe( rmvl_hik_manual_calib SOURCES sample_hik_manual_calib.cpp DEPENDS hik_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) diff --git a/samples/camera/mv/CMakeLists.txt b/samples/camera/mv/CMakeLists.txt index c4cfa3f8..92bfd42b 100644 --- a/samples/camera/mv/CMakeLists.txt +++ b/samples/camera/mv/CMakeLists.txt @@ -2,39 +2,37 @@ if(NOT BUILD_rmvl_mv_camera) return() endif() -find_package(OpenCV COMPONENTS highgui calib3d REQUIRED) - rmvl_add_exe( rmvl_mv_mono SOURCES sample_mv_mono.cpp DEPENDS mv_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) rmvl_add_exe( rmvl_mv_multi SOURCES sample_mv_multi.cpp DEPENDS mv_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) rmvl_add_exe( rmvl_mv_writer SOURCES sample_mv_writer.cpp DEPENDS mv_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) rmvl_add_exe( rmvl_mv_auto_calib SOURCES sample_mv_auto_calib.cpp DEPENDS mv_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) rmvl_add_exe( rmvl_mv_manual_calib SOURCES sample_mv_manual_calib.cpp DEPENDS mv_camera - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) diff --git a/samples/detector/hik/CMakeLists.txt b/samples/detector/hik/CMakeLists.txt index f2b3c308..c24db013 100644 --- a/samples/detector/hik/CMakeLists.txt +++ b/samples/detector/hik/CMakeLists.txt @@ -2,14 +2,12 @@ if(NOT BUILD_rmvl_hik_camera OR NOT BUILD_rmvl_armor_detector) return() endif() -find_package(OpenCV COMPONENTS highgui REQUIRED) - if(HAVE_FILESYSTEM) rmvl_add_exe( rmvl_hik_armor_collection SOURCES sample_hik_armor_collection.cpp DEPENDS hik_camera armor_detector - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) endif() @@ -17,5 +15,5 @@ rmvl_add_exe( rmvl_hik_armor_size_classify SOURCES sample_hik_armor_size_classify.cpp DEPENDS hik_camera armor_detector - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d opencv_ml ) diff --git a/samples/detector/mv/CMakeLists.txt b/samples/detector/mv/CMakeLists.txt index 89d69eaa..1e787e75 100644 --- a/samples/detector/mv/CMakeLists.txt +++ b/samples/detector/mv/CMakeLists.txt @@ -2,14 +2,12 @@ if(NOT BUILD_rmvl_mv_camera OR NOT BUILD_rmvl_armor_detector) return() endif() -find_package(OpenCV COMPONENTS highgui REQUIRED) - if(HAVE_FILESYSTEM) rmvl_add_exe( rmvl_mv_armor_collection SOURCES sample_mv_armor_collection.cpp DEPENDS mv_camera armor_detector - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d ) endif() @@ -17,5 +15,5 @@ rmvl_add_exe( rmvl_mv_armor_size_classify SOURCES sample_mv_armor_size_classify.cpp DEPENDS mv_camera armor_detector - EXTERNAL ${OpenCV_LIBS} + EXTERNAL opencv_highgui opencv_calib3d opencv_ml )