https://developer.android.google.cn/studio/projects/configure-cmake

https://blog.csdn.net/songmingzhan/article/details/80720903

# Sets the minimum version of CMake required to build the native
# library. You should either keep the default value or only pass a
# value of 3.4. or lower. cmake_minimum_required(VERSION 3.4.) # Creates and names a library, sets it as either STATIC
# or SHARED, and provides the relative paths to its source code.
# You can define multiple libraries, and CMake builds it for you.
# Gradle automatically packages shared libraries with your APK. add_library(samba_client
SHARED
src/main/cpp/jni_helper/JniHelper.cc
src/main/cpp/jni_helper/JavaClassCache.cc
src/main/cpp/samba_client/SambaClient.cc
src/main/cpp/credential_cache/CredentialCache.cc
) include_directories(src/main/cpp) set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++0x -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pie") # Searches for a specified prebuilt library and stores the path as a
# variable. Because system libraries are included in the search path by
# default, you only need to specify the name of the public NDK library
# you want to add. CMake verifies that the library exists before
# completing its build. find_library( # Sets the name of the path variable.
log-lib # Specifies the name of the NDK library that
# you want CMake to locate.
log ) # Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in the
# build script, prebuilt third-party libraries, or system libraries. #set(libfolder "${CMAKE_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}")
set(libfolder "${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}")
add_library(libsmbclient
SHARED
IMPORTED)
set_target_properties(libsmbclient
PROPERTIES IMPORTED_LOCATION
${libfolder}/libsmbclient.so) target_link_libraries(samba_client ${log-lib} libsmbclient)

android CMakeLists的更多相关文章

  1. Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt

    Android Studio 右键Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt错误 查 ...

  2. Android下Native的so编译:使用cmakelists.txt

    android studio的CMakeLists.txt写好后,在Studio中编译没问题,在命令编译时则需要配置很多参数才能成功 示例CMakeLists.txt文件: cmake_minimum ...

  3. Android Studio NDK 开发 问题记录

    Android NDK 开发 问题解决 编译:找不到gles3库 使用旧的编译方式,写Android.mk 进行编译.报错如下 gles3/gl3.h no such file or director ...

  4. Android Studio22-NDK-LLDB调试

    Android Studio2.2更好的支持NDK开发,并可以像开发java一样的DEBUG程序,不需要添加gradle-experimental插件,就可调试代码! 一,下载 NDK 和构建工具 要 ...

  5. ubuntu14.04 + cocos2d-x-3.6 + eclipse发布android

    cocos2d-x-2.2.6版本 :http://www.cnblogs.com/weishuan/p/4698470.html 接下来是3.6了 ,准备好下面四个东东,我把这些都放在XXX/App ...

  6. cocos2d-x 3.0rc开发指南:Windows下Android环境搭建

    安装工具 1. 配置JDK JDK下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html 本人的系统是Win7 ...

  7. Android -- Android下的NDK开发(一)

    1,NDK是什么?为什么要进行NDK开发? NDK:Native Development Kit.Android应用运行在Dalvik虚拟机中.NDK允许开发人员使用本地代码语言(例如C和C++)实现 ...

  8. 实时Android语音对讲系统架构

    本文属于Android局域网内的语音对讲项目系列,<通过UDP广播实现Android局域网Peer Discovering>实现了局域网内的广播及多播通信,本文将重点说明系统架构,音频信号 ...

  9. Android开发随手记

    本文是作者在Android开发实践中的随手速记,记录一些小问题的解决方案和注意事项,持续更新. 以下是速记内容,若有不严谨的地方,望小伙伴们指出. 1.Module 不生成R文件,可尝试取消对该Mod ...

随机推荐

  1. Java--static、final、static final的区别

    一.final final修饰类:表示该类不能被继承:final类中的方法默认是final的: final修饰方法:表示该方法无法被重写: final修饰方法参数:表示在变量的生存期中它的值不能被改变 ...

  2. java字符串的替换

    split也是用到了正则表达式 replace 是没有用正则表达式,全部替换 replaceAll 和replaceFirst是用了正则表达式 replaceAll替换所有,replaceFirst是 ...

  3. 把本地项目文件上传到github远程仓库的教程

    参考廖雪峰的git教程:https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000  非常详 ...

  4. Elasticsearch之settings和mappings的意义

    Elasticsearch之settings和mappings(图文详解)   Elasticsearch之settings和mappings的意义 简单的说,就是 settings是修改分片和副本数 ...

  5. android bluetooth

    Android bluetooth介绍(一):基本概念及硬件接口 BlueZ为调试和与蓝牙子系统通信提供很多设置命令行工具,包含下面这些: hciconfig hcitool hcidump sdpt ...

  6. PL/SQL类的应用

    类的定义 直接声明字段类型‘VARCHAR2或NUMBER等’ declare type kingsql_tp1 is record(empno number,ename varchar2(100)) ...

  7. 7 jmeter之参数化

    badboy里参数化(前面4 jmeter badboy脚本开发技术详解已讲过) jmeter里参数化-1 用户参数 1.打开badboy工具,点击红色按钮开始录制,在地址栏目中输入地址:www.so ...

  8. bootstrap模态框手动开启关闭与设置点击外部不关闭

    http://www.cnblogs.com/qlqwjy/p/7491054.html 完整的参考菜鸟教程:http://www.runoob.com/bootstrap/bootstrap-mod ...

  9. Spark性能优化(一)

    前言 在大数据计算领域,Spark已经成为了越来越流行.越来越受欢迎的计算平台之一.Spark的功能涵盖了大数据领域的离线批处理.SQL类处理.流式/实时计算.机器学习.图计算等各种不同类型的计算操作 ...

  10. [py]类和实例方法/内建方法

    内建方法 dir(__builtins__) 类和实例方法对比 class person: def __init__(self, job): self.job = job name = "m ...