Skip to content

Commit

Permalink
Find OpenCV in root CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold856 committed Jul 9, 2024
1 parent 63681e1 commit 7cd5696
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 6 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ endif()
if(WITH_CSCORE)
set(CAMERASERVER_DEP_REPLACE "find_dependency(cameraserver)")
set(CSCORE_DEP_REPLACE "find_dependency(cscore)")
find_package(OpenCV REQUIRED)
add_subdirectory(cscore)
add_subdirectory(cameraserver)
endif()
Expand Down
2 changes: 0 additions & 2 deletions cameraserver/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ project(cameraserver)
include(CompileWarnings)
include(AddTest)

find_package(OpenCV REQUIRED)

# Java bindings
if(WITH_JAVA)
include(UseJava)
Expand Down
2 changes: 0 additions & 2 deletions cscore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ include(CompileWarnings)
include(AddTest)
include(LinkMacOSGUI)

find_package(OpenCV REQUIRED)

file(GLOB cscore_native_src src/main/native/cpp/*.cpp)
file(GLOB cscore_linux_src src/main/native/linux/*.cpp)
file(GLOB cscore_osx_src src/main/native/osx/*.cpp)
Expand Down
1 change: 0 additions & 1 deletion wpilibc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ target_include_directories(
wpilib_target_warnings(wpilibc)

if(WITH_CSCORE)
find_package(OpenCV)
target_link_libraries(wpilibc PUBLIC cameraserver cscore ${OpenCV_LIBS})
else()
target_compile_definitions(wpilibc PRIVATE DYNAMIC_CAMERA_SERVER)
Expand Down
1 change: 0 additions & 1 deletion wpilibj/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ project(wpilibj)

# Java bindings
if(WITH_JAVA)
find_package(OpenCV REQUIRED)
include(UseJava)

set(OPENCV_JAVA_INSTALL_DIR ${OpenCV_INSTALL_PATH}/share/java/opencv4)
Expand Down

0 comments on commit 7cd5696

Please sign in to comment.