summarylogtreecommitdiffstats
path: root/be2eff7360e74ba4062e4c6a1f3328b5be1594c2.diff
blob: 9d3216b0b6174fe6d7578fb1aa9775c27e1dd1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 72a271b..4993b78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10)
 project(deepin-ocr)
 
 #3rdparty
-execute_process(COMMAND sh ${CMAKE_CURRENT_LIST_DIR}/build3rdparty.sh WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
+#execute_process(COMMAND sh ${CMAKE_CURRENT_LIST_DIR}/build3rdparty.sh WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
 
 option(DOTEST "option for test" OFF)
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 1f0198c..b0beede 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -32,14 +32,22 @@ add_definitions(${QT_DEFINITIONS})
 include(CMakePackageConfigHelpers)
 
 #for OpenCV-mobile
-include_directories(../3rdparty/opencv-4.5.4/build/install/include/opencv4)
-add_library(opencv_world STATIC IMPORTED)
-set_property(TARGET opencv_world PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/opencv-4.5.4/build/install/lib/libopencv_world.a)
+#include_directories(../3rdparty/opencv-4.5.4/build/install/include/opencv4)
+#add_library(opencv_world STATIC IMPORTED)
+#set_property(TARGET opencv_world PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/opencv-4.5.4/build/install/lib/libopencv_world.a)
+# vtk hdf5
+find_package(OpenCV REQUIRED COMPONENTS opencv_hdf opencv_imgproc opencv_imgcodecs)
+include_directories(${OpenCV_INCLUDE_DIRS})
+set(opencv_world ${OpenCV_LIBS})
 
 #for ncnn
-include_directories(../3rdparty/ncnn/build/install/include/ncnn)
+#set (ncnn_DIR "../3rdparty/ncnn/src" CACHE PATH "Directory that contains ncnnConfig.cmake")
+find_package(ncnn PATHS ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/ncnn/build/install/lib/cmake/ncnn)
+if (NOT ncnn_FOUND)
+include_directories(${CMAKE_CURRENT_LIST_DIR}/../3rdparty/ncnn/build/install/include/ncnn)
 add_library(ncnn STATIC IMPORTED)
 set_property(TARGET ncnn PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/ncnn/build/install/lib/libncnn.a)
+endif()
 
 #for clipper
 include_directories(../3rdparty/clipper)
@@ -146,10 +154,10 @@ if(DOTEST)
     qt5_use_modules(${PROJECT_NAME_TEST} ${QtModule})
 endif()
 
-target_link_libraries(${PROJECT_NAME} opencv_world ncnn Qt5::Core Qt5::Gui Qt5::Widgets ${dtk_lib_LIBRARIES} pthread dl -fopenmp)
+target_link_libraries(${PROJECT_NAME} ${opencv_world} ncnn Qt5::Core Qt5::Gui Qt5::Widgets ${dtk_lib_LIBRARIES} pthread dl -fopenmp)
 
 if(DOTEST)
-    target_link_libraries(${PROJECT_NAME_TEST} opencv_world ncnn Qt5::Core Qt5::Gui Qt5::Widgets ${dtk_lib_LIBRARIES} pthread dl -fopenmp)
+    target_link_libraries(${PROJECT_NAME_TEST} ${opencv_world} ncnn Qt5::Core Qt5::Gui Qt5::Widgets ${dtk_lib_LIBRARIES} pthread dl -fopenmp)
 endif()
 
 # install