当前位置:   article > 正文

android-cmake环境变量_export andtoolchain

export andtoolchain
1.配置profile

export PATH=$PATH:/home/opt/Qt5.5.0/5.5/gcc_64/bin:/lbg/arm-tools/bin:/home/lbg/download/gcc-arm-none-eabi-4_9-2015q2/bin:/home/lbg/download/Solaar-0.9.2/bin

#export ANDROID_NDK_ROOT=/opt/android/android-ndk-r8e

export ANDROID_NDK_ROOT=/lbg/android/android-ndk-r10

export ANDROID_SDK_ROOT=/lbg/android/sdk

export ANDROID_HOME=$ANDROID_SDK_ROOT

export ANDROID_NDK_HOME=$ANDROID_NDK_ROOT

export PATH=$PATH:$ANDROID_NDK_ROOT:$ANDROID_SDK_ROOT:$ANDROID_SDK_ROOT/platform-tools:/opt/Qt5.4.0/5.4/gcc_64/bin



export JAVA_HOME=/lbg/java/jdk1.7.0_79

export JRE_HOME=$JAVA_HOME/jre

export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH

export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH



export ANDROID_NDK_TOOLCHAIN_ROOT=/lbg/android/android-toolchain

export ANDROIDTOOLCHAIN=/lbg/android/android-cmake/android-cmake/toolchain/android.toolchain.cmake

alias android-cmake='cmake -DCMAKE_TOOLCHAIN_FILE=$ANDROIDTOOLCHAIN'



export GRADLE_HOME=/opt/gradle/gradle-2.10

export PATH=$GRADLE_HOME/bin:$PATH

2. source /etc/profile                       是让/etc/profile文件修改后立即生效,

3. 使用NDK创建单独的工具链:

./build/tools/make-standalone-toolchain.sh --platform=android-22 --install-dir=/lbg/android/android-toolchain-ndk-12 --arch=x86_64

4.进入android-cmake,执行: android-cmake ..

make -j8

make clean

1.添加cpp文件到 cmakelist

2.配置文件:# 指定生成目标

add_library (${target_name} SHARED ${source_files})

target_link_libraries (${target_name} ${thread_lib})

set (test_pvsdkapi_files

    src/tests/pvsdktest/pvsdkapitest.cpp)

add_library (test_pvsdkapi SHARED ${test_pvsdkapi_files})

target_link_libraries (test_pvsdkapi ${target_name} ${thread_lib} ${log_lib})

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/625248
推荐阅读
相关标签
  

闽ICP备14008679号