Skip to content

Commit

Permalink
Merge pull request opencv#1643 from alalek:cmake_fix_java_link_rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Donchenko authored and OpenCV Buildbot committed Oct 24, 2013
2 parents 7804240 + 4b17d07 commit 496859a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 12 additions & 0 deletions cmake/OpenCVUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ if(NOT COMMAND find_host_program)
endmacro()
endif()

# assert macro
# Note: it doesn't support lists in arguments
# Usage samples:
# ocv_assert(MyLib_FOUND)
# ocv_assert(DEFINED MyLib_INCLUDE_DIRS)
macro(ocv_assert)
if(NOT (${ARGN}))
string(REPLACE ";" " " __assert_msg "${ARGN}")
message(AUTHOR_WARNING "Assertion failed: ${__assert_msg}")
endif()
endmacro()

macro(ocv_check_environment_variables)
foreach(_var ${ARGN})
if(NOT DEFINED ${_var} AND DEFINED ENV{${_var}})
Expand Down
7 changes: 6 additions & 1 deletion modules/java/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ add_library(${the_module} SHARED ${handwrittren_h_sources} ${handwrittren_cpp_so
"${JAR_FILE}" "${JAR_FILE}.dephelper")
if(BUILD_FAT_JAVA_LIB)
set(__deps ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_MODULES_BUILD})
list(REMOVE_ITEM __deps ${the_module} opencv_ts)
foreach(m ${OPENCV_MODULES_BUILD}) # filterout INTERNAL (like opencv_ts) and BINDINGS (like opencv_python) modules
ocv_assert(DEFINED OPENCV_MODULE_${m}_CLASS)
if(NOT OPENCV_MODULE_${m}_CLASS STREQUAL "PUBLIC")
list(REMOVE_ITEM __deps ${m})
endif()
endforeach()
ocv_list_unique(__deps)
set(__extradeps ${__deps})
ocv_list_filterout(__extradeps "^opencv_")
Expand Down

0 comments on commit 496859a

Please sign in to comment.