From bbfbdd9da1c9cb8247d1e6fee23139a3cd2fb900 Mon Sep 17 00:00:00 2001 From: apavlenko Date: Fri, 18 Nov 2016 10:40:47 +0300 Subject: [PATCH 1/2] moving hal to a separate folder --- 3rdparty/openvx/CMakeLists.txt | 7 ++++--- 3rdparty/openvx/hal/README.md | 4 ++++ 3rdparty/openvx/{src => hal}/openvx_hal.cpp | 0 3rdparty/openvx/{include => hal}/openvx_hal.hpp | 0 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 3rdparty/openvx/hal/README.md rename 3rdparty/openvx/{src => hal}/openvx_hal.cpp (100%) rename 3rdparty/openvx/{include => hal}/openvx_hal.hpp (100%) diff --git a/3rdparty/openvx/CMakeLists.txt b/3rdparty/openvx/CMakeLists.txt index 4c71ecfe6b..699cf91617 100644 --- a/3rdparty/openvx/CMakeLists.txt +++ b/3rdparty/openvx/CMakeLists.txt @@ -1,5 +1,6 @@ -add_library(openvx_hal STATIC src/openvx_hal.cpp include/openvx_hal.hpp include/ivx.hpp include/ivx_lib_debug.hpp) +add_library(openvx_hal STATIC hal/openvx_hal.cpp hal/openvx_hal.hpp include/ivx.hpp include/ivx_lib_debug.hpp) target_include_directories(openvx_hal PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/hal ${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/modules/core/include ${CMAKE_SOURCE_DIR}/modules/imgproc/include @@ -14,5 +15,5 @@ endif() set(OPENVX_HAL_FOUND TRUE PARENT_SCOPE) set(OPENVX_HAL_VERSION 0.0.1 PARENT_SCOPE) set(OPENVX_HAL_LIBRARIES "openvx_hal" PARENT_SCOPE) -set(OPENVX_HAL_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/openvx_hal.hpp" PARENT_SCOPE) -set(OPENVX_HAL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" "${OPENVX_INCLUDE_DIR}" PARENT_SCOPE) +set(OPENVX_HAL_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/hal/openvx_hal.hpp" PARENT_SCOPE) +set(OPENVX_HAL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/hal" "${OPENVX_INCLUDE_DIR}" PARENT_SCOPE) diff --git a/3rdparty/openvx/hal/README.md b/3rdparty/openvx/hal/README.md new file mode 100644 index 0000000000..a4266015a7 --- /dev/null +++ b/3rdparty/openvx/hal/README.md @@ -0,0 +1,4 @@ +#OpenVX-based HAL implementation. +It's built when OpenVX is available (`HAVE_OPENVX`). +To build OpenCV with OpenVX support add the following **cmake** options: +`-DOPENVX_ROOT=/path/to/prebuilt/openvx -DWITH_OPENVX=YES` \ No newline at end of file diff --git a/3rdparty/openvx/src/openvx_hal.cpp b/3rdparty/openvx/hal/openvx_hal.cpp similarity index 100% rename from 3rdparty/openvx/src/openvx_hal.cpp rename to 3rdparty/openvx/hal/openvx_hal.cpp diff --git a/3rdparty/openvx/include/openvx_hal.hpp b/3rdparty/openvx/hal/openvx_hal.hpp similarity index 100% rename from 3rdparty/openvx/include/openvx_hal.hpp rename to 3rdparty/openvx/hal/openvx_hal.hpp From 2312131e274a0409e6f6f7f194c2007edab2b6c6 Mon Sep 17 00:00:00 2001 From: apavlenko Date: Mon, 21 Nov 2016 13:16:56 +0300 Subject: [PATCH 2/2] moving HAL-related CMakeLists.txt to 'hal' sub-dir --- 3rdparty/openvx/CMakeLists.txt | 22 +++++----------------- 3rdparty/openvx/hal/CMakeLists.txt | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 3rdparty/openvx/hal/CMakeLists.txt diff --git a/3rdparty/openvx/CMakeLists.txt b/3rdparty/openvx/CMakeLists.txt index 699cf91617..41fd377d70 100644 --- a/3rdparty/openvx/CMakeLists.txt +++ b/3rdparty/openvx/CMakeLists.txt @@ -1,19 +1,7 @@ -add_library(openvx_hal STATIC hal/openvx_hal.cpp hal/openvx_hal.hpp include/ivx.hpp include/ivx_lib_debug.hpp) -target_include_directories(openvx_hal PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/hal - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_SOURCE_DIR}/modules/core/include - ${CMAKE_SOURCE_DIR}/modules/imgproc/include - ${OPENVX_INCLUDE_DIR}) -target_link_libraries(openvx_hal LINK_PUBLIC ${OPENVX_LIBRARIES}) -set_target_properties(openvx_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE) -set_target_properties(openvx_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}) -if(NOT BUILD_SHARED_LIBS) - ocv_install_target(openvx_hal EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev) +if(NOT HAVE_OPENVX) + message(STATUS "OpenVX is not available, disabling openvx-related HAL and stuff") + return() endif() -set(OPENVX_HAL_FOUND TRUE PARENT_SCOPE) -set(OPENVX_HAL_VERSION 0.0.1 PARENT_SCOPE) -set(OPENVX_HAL_LIBRARIES "openvx_hal" PARENT_SCOPE) -set(OPENVX_HAL_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/hal/openvx_hal.hpp" PARENT_SCOPE) -set(OPENVX_HAL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/hal" "${OPENVX_INCLUDE_DIR}" PARENT_SCOPE) +set(OPENCV_3P_OPENVX_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +add_subdirectory(hal) \ No newline at end of file diff --git a/3rdparty/openvx/hal/CMakeLists.txt b/3rdparty/openvx/hal/CMakeLists.txt new file mode 100644 index 0000000000..519d8d731f --- /dev/null +++ b/3rdparty/openvx/hal/CMakeLists.txt @@ -0,0 +1,19 @@ +add_library(openvx_hal STATIC openvx_hal.cpp openvx_hal.hpp ${OPENCV_3P_OPENVX_DIR}/include/ivx.hpp ${OPENCV_3P_OPENVX_DIR}/include/ivx_lib_debug.hpp) +target_include_directories(openvx_hal PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${OPENCV_3P_OPENVX_DIR}/include + ${CMAKE_SOURCE_DIR}/modules/core/include + ${CMAKE_SOURCE_DIR}/modules/imgproc/include + ${OPENVX_INCLUDE_DIR}) +target_link_libraries(openvx_hal LINK_PUBLIC ${OPENVX_LIBRARIES}) +set_target_properties(openvx_hal PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +set_target_properties(openvx_hal PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH}) +if(NOT BUILD_SHARED_LIBS) + ocv_install_target(openvx_hal EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev) +endif() + +set(OPENVX_HAL_FOUND TRUE CACHE INTERNAL "") +set(OPENVX_HAL_VERSION 0.0.1 CACHE INTERNAL "") +set(OPENVX_HAL_LIBRARIES "openvx_hal" CACHE INTERNAL "") +set(OPENVX_HAL_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/openvx_hal.hpp" CACHE INTERNAL "") +set(OPENVX_HAL_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}" "${OPENCV_3P_OPENVX_DIR}/include" "${OPENVX_INCLUDE_DIR}" CACHE INTERNAL "")