adding some small changes to support android build,

mainly cmake stuff, but in persistance the wcstombs
is not supported on android, and in
sift.cpp there was and ifdef that affected arm and this
causes undefined symbols on android.
This commit is contained in:
Ethan Rublee 2010-09-22 02:16:33 +00:00
parent a732082526
commit 8ee50c422b
5 changed files with 44 additions and 6 deletions

View File

@ -1,3 +1,7 @@
if(ANDROID)
configure_file("${CMAKE_SOURCE_DIR}/Android.mk.modules.in" "${CMAKE_CURRENT_BINARY_DIR}/Android.mk")
endif()
add_subdirectory(calib3d)
add_subdirectory(core)
add_subdirectory(features2d)
@ -20,8 +24,13 @@ if(PYTHONLIBS_FOUND AND BUILD_NEW_PYTHON_SUPPORT)
endif()
add_subdirectory(video)
if(!ANDROID)
add_subdirectory(haartraining)
add_subdirectory(traincascade)
add_subdirectory(gpu)
endif()

View File

@ -114,7 +114,7 @@ cv::string cv::FileStorage::getDefaultObjectName(const string& _filename)
namespace cv
{
#ifndef ANDROID //unsuported wcstombs on android
string fromUtf16(const WString& str)
{
cv::AutoBuffer<char> _buf(str.size()*4 + 1);
@ -138,7 +138,7 @@ WString toUtf16(const string& str)
buf[sz] = '\0';
return WString(buf);
}
#endif
}
typedef struct CvGenericHash

View File

@ -1 +1,2 @@
define_opencv_module(features2d opencv_core opencv_imgproc opencv_calib3d opencv_highgui)

View File

@ -48,7 +48,15 @@
#include "precomp.hpp"
#ifndef __arm__
#ifdef __arm__
#define ARM_NO_SIFT
#endif
#ifdef ANDROID
#undef ARM_NO_SIFT
#endif //ANDROID
#ifndef ARM_NO_SIFT
#include <iostream>
#include <limits>
@ -175,6 +183,7 @@ public:
typedef Keypoints::iterator KeypointsIter ; ///< Keypoint list iter datatype
typedef Keypoints::const_iterator KeypointsConstIter ; ///< Keypoint list const iter datatype
#undef _S
/** @brief Constructors and destructors */
/*@{*/
Sift(const pixel_t* _im_pt, int _width, int _height,

View File

@ -3,6 +3,7 @@
# Some parts taken from version of Hartmut Seichter, HIT Lab NZ.
# Jose Luis Blanco, 2008
# ----------------------------------------------------------------------------
if(!ANDROID)
project(opencv_highgui)
if(WITH_JPEG)
@ -332,3 +333,21 @@ install(TARGETS ${the_target}
install(FILES ${highgui_ext_hdrs}
DESTINATION include/opencv2/highgui
COMPONENT main)
else(!ANDROID)
set(high_gui_android_srcs src/bitstrm.cpp
src/cap.cpp
src/grfmt_base.cpp
src/grfmt_bmp.cpp
src/grfmt_jpeg.cpp
src/grfmt_jpeg2000.cpp
src/grfmt_png.cpp
src/grfmt_tiff.cpp
src/loadsave.cpp
src/precomp.cpp
src/utils.cpp
src/grfmt_sunras.cpp
src/grfmt_pxm.cpp
src/window.cpp )
define_android_manual(highgui "${high_gui_android_srcs}" "$(LOCAL_PATH)/src $(OPENCV_INCLUDES)")
endif(!ANDROID)