【cmake编译android平台的libPoco】一箫一剑平生意,负尽狂名十五年。这篇文章主要讲述cmake编译android平台的libPoco相关的知识,希望能为你提供帮助。
1、下载源代码,解压到POCO-1.7.8-ALL
2、从$android_NDK\cmake下复制android.toolchain.cmake AndroidNdkGdb.cmake AndroidNdkModules.cmake至POCO-1.7.8-ALL\cmake\下
3、vim
POCO-1.7.8-ALL\cmake\android.cmake,内容如下
#cd
POCO-1.7.8-ALL
#mkdir
BUILD
&
&
cd
BUILD
#cmake
-DCMAKE_CXX_FLAGS=‘-frtti
-fexceptions
-fpermissive‘
..
#make
-j4
set(CMAKE_BUILD_TYPE
Release)
set(ANDROID
1)
set(CMAKE_CXX_FLAGS
"-fexceptions")
set(CMAKE_CXX_FLAGS_DEBUG
-fexceptions)
#set(
$ANDROID_NDK/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin)
set(CMAKE_TOOLCHAIN_FILE
${CMAKE_CURRENT_SOURCE_DIR}/cmake/android.toolchain.cmake)
set(ANDROID_STL
stlport_static)
set(ANDROID_NDK
/Users/musictom/Library/Android/sdk/ndk-bundle/)
set(ANDROID_TOOLCHAIN_NAME
aarch64-linux-android-4.9)
set(ANDROID_ABI
arm64-v8a)
set(ANDROID_NATIVE_API_LEVEL
android-24)
set(CPACK_PACKAGE_INSTALL_DIRECTORY
"/libs")
#add_compile_options(-std=c++11)
#message(STATUS
"optional:-std=c++11")
4、
cd
POCO-1.7.8-ALL
mkdir
BUILD
&
&
cd
BUILD
cmake
-DCMAKE_CXX_FLAGS=‘-frtti
-fexceptions
-fpermissive‘
..
make
-j4
推荐阅读
- Android 图片加载框架Universal-Image-Loader源码解析
- Android商城开发系列—— 使用RecyclerView展示首页数据
- 安卓开发中Sqlte的学习心得
- uses-sdk:minSdkVersion 1 cannot be smaller than version 4 declared in library [com.android.support:s
- AppInventor2笔记
- Android启动模式以及IntentFilter匹配规则
- Android DDMS应用
- android生成分享长图并且添加全图水印
- appium 环境安装