Merge pull request #10907 from alalek:cmake_ninja_fix

This commit is contained in:
Alexander Alekhin 2018-02-20 18:54:43 +00:00
commit 5f5fcef962

View File

@ -21,7 +21,9 @@ set(depends ${the_module}_jar_source_copy "${OPENCV_DEPHELPER}/${the_module}_jar
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.xml.in" "${OPENCV_JAVA_DIR}/build.xml" @ONLY) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build.xml.in" "${OPENCV_JAVA_DIR}/build.xml" @ONLY)
list(APPEND depends "${OPENCV_JAVA_DIR}/build.xml") list(APPEND depends "${OPENCV_JAVA_DIR}/build.xml")
ocv_cmake_byproducts(__byproducts BYPRODUCTS "${OPENCV_JAR_FILE}")
add_custom_command(OUTPUT "${OPENCV_DEPHELPER}/${the_module}_jar" add_custom_command(OUTPUT "${OPENCV_DEPHELPER}/${the_module}_jar"
${__byproducts} # required for add_custom_target() by ninja
COMMAND ${ANT_EXECUTABLE} -noinput -k jar COMMAND ${ANT_EXECUTABLE} -noinput -k jar
COMMAND ${CMAKE_COMMAND} -E touch "${OPENCV_DEPHELPER}/${the_module}_jar" COMMAND ${CMAKE_COMMAND} -E touch "${OPENCV_DEPHELPER}/${the_module}_jar"
WORKING_DIRECTORY "${OPENCV_JAVA_DIR}" WORKING_DIRECTORY "${OPENCV_JAVA_DIR}"