|
@@ -17,7 +17,6 @@ SET(OPENCV_DIR "" CACHE PATH "Location of libraries")
|
|
|
SET(ENCRYPTION_DIR"" CACHE PATH "Location of libraries")
|
|
SET(ENCRYPTION_DIR"" CACHE PATH "Location of libraries")
|
|
|
SET(CUDA_LIB "" CACHE PATH "Location of libraries")
|
|
SET(CUDA_LIB "" CACHE PATH "Location of libraries")
|
|
|
|
|
|
|
|
-
|
|
|
|
|
if (NOT WIN32)
|
|
if (NOT WIN32)
|
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
|
@@ -51,7 +50,9 @@ endmacro()
|
|
|
|
|
|
|
|
|
|
|
|
|
if (WITH_ENCRYPTION)
|
|
if (WITH_ENCRYPTION)
|
|
|
-add_definitions( -DWITH_ENCRYPTION=${WITH_ENCRYPTION})
|
|
|
|
|
|
|
+ if (NOT (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64"))
|
|
|
|
|
+ add_definitions( -DWITH_ENCRYPTION=${WITH_ENCRYPTION})
|
|
|
|
|
+ endif()
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
if (WITH_MKL)
|
|
if (WITH_MKL)
|
|
@@ -62,8 +63,10 @@ if (NOT DEFINED PADDLE_DIR OR ${PADDLE_DIR} STREQUAL "")
|
|
|
message(FATAL_ERROR "please set PADDLE_DIR with -DPADDLE_DIR=/path/paddle_influence_dir")
|
|
message(FATAL_ERROR "please set PADDLE_DIR with -DPADDLE_DIR=/path/paddle_influence_dir")
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
-if (NOT DEFINED OPENCV_DIR OR ${OPENCV_DIR} STREQUAL "")
|
|
|
|
|
|
|
+if (NOT (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64"))
|
|
|
|
|
+ if (NOT DEFINED OPENCV_DIR OR ${OPENCV_DIR} STREQUAL "")
|
|
|
message(FATAL_ERROR "please set OPENCV_DIR with -DOPENCV_DIR=/path/opencv")
|
|
message(FATAL_ERROR "please set OPENCV_DIR with -DOPENCV_DIR=/path/opencv")
|
|
|
|
|
+ endif()
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
include_directories("${CMAKE_SOURCE_DIR}/")
|
|
include_directories("${CMAKE_SOURCE_DIR}/")
|
|
@@ -111,10 +114,17 @@ if (WIN32)
|
|
|
find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/build/ NO_DEFAULT_PATH)
|
|
find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/build/ NO_DEFAULT_PATH)
|
|
|
unset(OpenCV_DIR CACHE)
|
|
unset(OpenCV_DIR CACHE)
|
|
|
else ()
|
|
else ()
|
|
|
- find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/share/OpenCV NO_DEFAULT_PATH)
|
|
|
|
|
|
|
+ if (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") # x86_64 aarch64
|
|
|
|
|
+ set(OpenCV_INCLUDE_DIRS "/usr/include/opencv4")
|
|
|
|
|
+ file(GLOB OpenCV_LIBS /usr/lib/aarch64-linux-gnu/libopencv_*${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
|
|
|
+ message("OpenCV libs: ${OpenCV_LIBS}")
|
|
|
|
|
+ else()
|
|
|
|
|
+ find_package(OpenCV REQUIRED PATHS ${OPENCV_DIR}/share/OpenCV NO_DEFAULT_PATH)
|
|
|
|
|
+ endif()
|
|
|
include_directories("${PADDLE_DIR}/paddle/include")
|
|
include_directories("${PADDLE_DIR}/paddle/include")
|
|
|
link_directories("${PADDLE_DIR}/paddle/lib")
|
|
link_directories("${PADDLE_DIR}/paddle/lib")
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
+
|
|
|
include_directories(${OpenCV_INCLUDE_DIRS})
|
|
include_directories(${OpenCV_INCLUDE_DIRS})
|
|
|
|
|
|
|
|
if (WIN32)
|
|
if (WIN32)
|
|
@@ -260,9 +270,11 @@ endif()
|
|
|
|
|
|
|
|
if(WITH_ENCRYPTION)
|
|
if(WITH_ENCRYPTION)
|
|
|
if(NOT WIN32)
|
|
if(NOT WIN32)
|
|
|
|
|
+ if (NOT (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64"))
|
|
|
include_directories("${ENCRYPTION_DIR}/include")
|
|
include_directories("${ENCRYPTION_DIR}/include")
|
|
|
link_directories("${ENCRYPTION_DIR}/lib")
|
|
link_directories("${ENCRYPTION_DIR}/lib")
|
|
|
set(DEPS ${DEPS} ${ENCRYPTION_DIR}/lib/libpmodel-decrypt${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
set(DEPS ${DEPS} ${ENCRYPTION_DIR}/lib/libpmodel-decrypt${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
|
|
|
+ endif()
|
|
|
else()
|
|
else()
|
|
|
include_directories("${ENCRYPTION_DIR}/include")
|
|
include_directories("${ENCRYPTION_DIR}/include")
|
|
|
link_directories("${ENCRYPTION_DIR}/lib")
|
|
link_directories("${ENCRYPTION_DIR}/lib")
|
|
@@ -276,6 +288,7 @@ if (NOT WIN32)
|
|
|
endif()
|
|
endif()
|
|
|
|
|
|
|
|
set(DEPS ${DEPS} ${OpenCV_LIBS})
|
|
set(DEPS ${DEPS} ${OpenCV_LIBS})
|
|
|
|
|
+
|
|
|
add_library(paddlex_inference SHARED src/visualize src/transforms.cpp src/paddlex.cpp)
|
|
add_library(paddlex_inference SHARED src/visualize src/transforms.cpp src/paddlex.cpp)
|
|
|
ADD_DEPENDENCIES(paddlex_inference ext-yaml-cpp)
|
|
ADD_DEPENDENCIES(paddlex_inference ext-yaml-cpp)
|
|
|
target_link_libraries(paddlex_inference ${DEPS})
|
|
target_link_libraries(paddlex_inference ${DEPS})
|