android-cmake环境变量
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/ake
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
java环境变量自动配置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})

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。