Skip to content

Commit

Permalink
Add check to not include opencv twice when including comm
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Costinescu committed Feb 12, 2022
1 parent 1939c9c commit 5a7d862
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cmake/packageConfigComponents.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ endforeach()
### ADD EXTERNAL DEPENDENCIES IF NEEDED: opencv ###

if (${@PROJECT_NAME@_REQUEST_OPENCV})
if ("${OPENCV_VERSION}" STREQUAL "")
find_package(OpenCV REQUIRED COMPONENTS highgui)
else ()
find_package(OpenCV ${OPENCV_VERSION} REQUIRED COMPONENTS highgui)
if ((NOT DEFINED OPENCV_HIGHGUI_FOUND) OR (NOT ${OPENCV_HIGHGUI_FOUND}) OR (NOT DEFINED OpenCV_highgui_FOUND) OR (NOT ${OpenCV_highgui_FOUND}))
if ("${OPENCV_VERSION}" STREQUAL "")
find_package(OpenCV REQUIRED COMPONENTS highgui)
else ()
find_package(OpenCV ${OPENCV_VERSION} REQUIRED COMPONENTS highgui)
endif ()

include_directories(${OpenCV_INCLUDE_DIRS})
set(@PROJECT_NAME@_EXTERNAL_LIBRARIES ${OpenCV_LIBS} ${@PROJECT_NAME@_EXTERNAL_LIBRARIES})
endif ()

include_directories(${OpenCV_INCLUDE_DIRS})
set(@PROJECT_NAME@_EXTERNAL_LIBRARIES ${OpenCV_LIBS} ${@PROJECT_NAME@_EXTERNAL_LIBRARIES})
endif ()

### START POPULATING @PROJECT_NAME@_INCLUDE and @PROJECT_NAME@_LIBRARY variables
Expand Down

0 comments on commit 5a7d862

Please sign in to comment.