File tree Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Expand file tree Collapse file tree 3 files changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_LIST_DIR)
11
11
# ----------------------------------------------------------------------------
12
12
13
13
add_subdirectory (cpp )
14
+ add_subdirectory (java/tutorial_code )
14
15
add_subdirectory (dnn )
15
16
add_subdirectory (gpu )
16
17
add_subdirectory (tapi )
Original file line number Diff line number Diff line change
1
+ # ----------------------------------------------------------------------------
2
+ # CMake file for Java tutorials compilation.
3
+ #
4
+ # ----------------------------------------------------------------------------
5
+ if (NOT ANT_EXECUTABLE OR NOT TARGET opencv_java )
6
+ return ()
7
+ endif ()
8
+
9
+ project (compile_java_tutorials )
10
+
11
+ set (curdir "${CMAKE_CURRENT_SOURCE_DIR} " )
12
+ set (opencv_tutorial_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR} /.compiled" )
13
+ set (TUTORIALS_DIRS "" )
14
+
15
+ file (GLOB children RELATIVE ${curdir} ${curdir} /*/* )
16
+ foreach (child ${children} )
17
+ if (IS_DIRECTORY ${curdir} /${child} )
18
+ file (GLOB contains_java_files "${child} /*.java" )
19
+ if (contains_java_files )
20
+ list (APPEND TUTORIALS_DIRS ${child} )
21
+ endif ()
22
+ endif ()
23
+ endforeach ()
24
+
25
+ add_custom_target ("${PROJECT_NAME} "
26
+ DEPENDS opencv_java
27
+ )
28
+
29
+ foreach (TUTORIAL_DIR ${TUTORIALS_DIRS} )
30
+ get_filename_component (TUTORIAL_NAME ${TUTORIAL_DIR} NAME_WE )
31
+ add_custom_command (TARGET "${PROJECT_NAME} "
32
+ COMMAND ${ANT_EXECUTABLE} -q
33
+ -DocvJarDir= "${OpenCV_BINARY_DIR} /bin"
34
+ -DsrcDir= "${TUTORIAL_DIR} "
35
+ -DdstDir= "${opencv_tutorial_java_bin_dir} /${TUTORIAL_NAME} "
36
+ WORKING_DIRECTORY "${curdir} "
37
+ COMMENT "Compile the tutorial: ${TUTORIAL_NAME} "
38
+ )
39
+ endforeach ()
Original file line number Diff line number Diff line change
1
+ <project default =" compile" >
2
+
3
+ <property name =" lib.dir" value =" ${ ocvJarDir } " />
4
+ <path id =" classpath" >
5
+ <fileset dir =" ${ lib.dir } " includes =" **/*.jar" />
6
+ </path >
7
+
8
+ <target name =" compile" >
9
+ <mkdir dir =" ${ dstDir } " />
10
+ <javac includeantruntime =" false" srcdir =" ${ srcDir } " destdir =" ${ dstDir } " classpathref =" classpath" />
11
+ </target >
12
+
13
+ </project >
You can’t perform that action at this time.
0 commit comments