modding the 3rdparty CMakeLists.txt to allow for android compilation using cmake
Basically just adding lines at top of CMakeLists that alter behavior if ANDROID is set to true.
This commit is contained in:
Vendored
+7
@@ -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()
|
||||
|
||||
Vendored
+5
@@ -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
|
||||
|
||||
Vendored
+5
@@ -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
|
||||
|
||||
Vendored
+11
@@ -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
|
||||
|
||||
Vendored
+5
@@ -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
|
||||
|
||||
Vendored
+4
@@ -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
|
||||
|
||||
Vendored
+5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user