diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index ab7052381..d06040d9e 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -1,3 +1,7 @@ +if(ANDROID) + configure_file("${CMAKE_SOURCE_DIR}/Android.mk.modules.in" "${CMAKE_CURRENT_BINARY_DIR}/Android.mk") +endif() + add_subdirectory(flann) add_subdirectory(lapack) add_subdirectory(zlib) @@ -13,4 +17,7 @@ endif() if(WITH_TIFF AND NOT TIFF_FOUND) add_subdirectory(libtiff) endif() + +if(NOT ANDROID) add_subdirectory(gtest) +endif() diff --git a/3rdparty/flann/CMakeLists.txt b/3rdparty/flann/CMakeLists.txt index 8e41fd4d4..f4bb6889c 100644 --- a/3rdparty/flann/CMakeLists.txt +++ b/3rdparty/flann/CMakeLists.txt @@ -1,3 +1,7 @@ +if(ANDROID) +file(GLOB_RECURSE flann_sources_cpp *.cpp) +define_android_manual(flann "${flann_sources_cpp}" "$(LOCAL_PATH)/../include $(LOCAL_PATH)/../include/flann") +else(ANDROID) if (DEFINED OPENCV_VERSION) # ---------------------------------------------------------------------------- @@ -100,3 +104,4 @@ INSTALL ( ) ENDIF() +endif(ANDROID)#android diff --git a/3rdparty/lapack/CMakeLists.txt b/3rdparty/lapack/CMakeLists.txt index 933e7cab4..6f498bd9e 100644 --- a/3rdparty/lapack/CMakeLists.txt +++ b/3rdparty/lapack/CMakeLists.txt @@ -2,6 +2,10 @@ # CMake file for opencv_lapack. See root CMakeLists.txt # # ---------------------------------------------------------------------------- +if(ANDROID) +define_3rdparty_module(opencv_lapack) +else() + project(opencv_lapack) # List of C++ files: @@ -56,3 +60,4 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/lib ) +endif() #android diff --git a/3rdparty/libjasper/CMakeLists.txt b/3rdparty/libjasper/CMakeLists.txt index 0564cae95..72f0d297e 100644 --- a/3rdparty/libjasper/CMakeLists.txt +++ b/3rdparty/libjasper/CMakeLists.txt @@ -1,9 +1,17 @@ +if(ANDROID) +set(android_defs "-DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT") +define_3rdparty_module(jasper) +set(android_defs "") +else(ANDROID) + + # ---------------------------------------------------------------------------- # CMake file for libjasper. See root CMakeLists.txt # # ---------------------------------------------------------------------------- project(libjasper) + add_definitions(-DEXCLUDE_MIF_SUPPORT -DEXCLUDE_PNM_SUPPORT -DEXCLUDE_BMP_SUPPORT -DEXCLUDE_RAS_SUPPORT -DEXCLUDE_JPG_SUPPORT -DEXCLUDE_PGX_SUPPORT) # List of C++ files: @@ -41,9 +49,12 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-implicit-function-declaration -Wno-unused") endif() + + set_target_properties(${the_target} PROPERTIES OUTPUT_NAME "${the_target}" DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib" ) +endif(ANDROID)#!android diff --git a/3rdparty/libjpeg/CMakeLists.txt b/3rdparty/libjpeg/CMakeLists.txt index fabfa8fb8..952a21217 100644 --- a/3rdparty/libjpeg/CMakeLists.txt +++ b/3rdparty/libjpeg/CMakeLists.txt @@ -1,3 +1,7 @@ +if(ANDROID) +define_3rdparty_module(jpeg) +else() +#endif()#android # ---------------------------------------------------------------------------- # CMake file for libjpeg. See root CMakeLists.txt # @@ -39,3 +43,4 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/3rdparty/lib ) +endif()#android diff --git a/3rdparty/libpng/CMakeLists.txt b/3rdparty/libpng/CMakeLists.txt index 4fb7e6ade..85d314e90 100644 --- a/3rdparty/libpng/CMakeLists.txt +++ b/3rdparty/libpng/CMakeLists.txt @@ -1,3 +1,6 @@ +if(ANDROID) +define_3rdparty_module(png) +else() # ---------------------------------------------------------------------------- # CMake file for libpng. See root CMakeLists.txt # @@ -38,3 +41,4 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib" ) +endif()#android diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt index 1594f5e97..67b1f34f8 100644 --- a/3rdparty/zlib/CMakeLists.txt +++ b/3rdparty/zlib/CMakeLists.txt @@ -1,3 +1,6 @@ +if(ANDROID) +define_3rdparty_module(zlib) +else() # ---------------------------------------------------------------------------- # CMake file for zlib. See root CMakeLists.txt # @@ -35,3 +38,5 @@ set_target_properties(${the_target} DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/3rdparty/lib" ) + +endif(ANDROID)