Skip to content

Commit 9884915

Browse files
committed
formating style and making changes accordingly to review
1 parent fd91072 commit 9884915

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

samples/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ add_subdirectory(cpp)
8383
add_subdirectory(dnn)
8484
# FIXIT: can't use cvconfig.h in samples: add_subdirectory(gpu)
8585

86-
add_subdirectory(java/tutorial_code)
87-
8886
add_subdirectory(opencl)
8987

9088
if(WIN32)

samples/java/tutorial_code/CMakeLists.txt

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,38 @@
22
# CMake file for Java tutorials compilation.
33
#
44
# ----------------------------------------------------------------------------
5-
if(NOT ANT_EXECUTABLE)
5+
if(NOT ANT_EXECUTABLE OR NOT TARGET opencv_java)
66
return()
77
endif()
88

99
project(compile_java_tutorials)
1010

1111
set(curdir "${CMAKE_CURRENT_SOURCE_DIR}")
1212
set(opencv_tutorial_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.compiled")
13-
set(target_name "compile_java_tutorials")
1413
set(TUTORIALS_DIRS "")
1514

16-
FILE(GLOB children RELATIVE ${curdir} ${curdir}/*/*)
17-
FOREACH(child ${children})
15+
file(GLOB children RELATIVE ${curdir} ${curdir}/*/*)
16+
foreach(child ${children})
1817
if(IS_DIRECTORY ${curdir}/${child})
19-
FILE(GLOB contains_java_files "${child}/*.java")
18+
file(GLOB contains_java_files "${child}/*.java")
2019
if(contains_java_files)
21-
LIST(APPEND TUTORIALS_DIRS ${child})
20+
list(APPEND TUTORIALS_DIRS ${child})
2221
endif()
2322
endif()
24-
ENDFOREACH()
23+
endforeach()
2524

26-
add_custom_target("${target_name}" ALL
25+
add_custom_target("${PROJECT_NAME}"
2726
DEPENDS opencv_java
2827
)
2928

30-
FOREACH(tutorial_dir ${TUTORIALS_DIRS})
31-
get_filename_component(tutorial_name ${tutorial_dir} NAME_WE)
32-
add_custom_command(TARGET "${target_name}"
29+
foreach(TUTORIAL_DIR ${TUTORIALS_DIRS})
30+
get_filename_component(TUTORIAL_NAME ${TUTORIAL_DIR} NAME_WE)
31+
add_custom_command(TARGET "${PROJECT_NAME}"
3332
COMMAND ${ANT_EXECUTABLE} -q
3433
-DocvJarDir="${OpenCV_BINARY_DIR}/bin"
35-
-DsrcDir="${tutorial_dir}"
36-
-DdstDir="${opencv_tutorial_java_bin_dir}/${tutorial_name}"
34+
-DsrcDir="${TUTORIAL_DIR}"
35+
-DdstDir="${opencv_tutorial_java_bin_dir}/${TUTORIAL_NAME}"
3736
WORKING_DIRECTORY "${curdir}"
38-
COMMENT "Compile the tutorial: ${tutorial_name}"
37+
COMMENT "Compile the tutorial: ${TUTORIAL_NAME}"
3938
)
40-
ENDFOREACH()
39+
endforeach()

0 commit comments

Comments
 (0)