Cmake一次编译多个cpp
来源:互联网 发布:阿里云培训 编辑:程序博客网 时间:2024/06/05 06:19
Module下有一个CMakeLists.txt 的文件 默认内容是这样的,(只贴了需要改动的部分)
cmake_minimum_required(VERSION 3.4.1)# 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( # Sets the name of the library. native-lib # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). # Associated headers in the same location as their source # file are automatically included. src/main/cpp/native-lib.cpp )
改为
cmake_minimum_required(VERSION 3.4.1)# 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.file(GLOB native_srcs "src/main/cpp/*.cpp")add_library( # Sets the name of the library. native-lib # Sets the library as a shared library. SHARED # Provides a relative path to your source file(s). # Associated headers in the same location as their source # file are automatically included. ${native_srcs})
哈哈,大功告成!再多个cpp都不成问题啦!快去动手试试吧
阅读全文
0 0
- Cmake一次编译多个cpp
- NDK编译多个cpp
- maven如何一次编译多个工程
- 工作积累之NDK编译多个cpp
- 命令行下编译多个C/CPP文件
- matlab采用mex编译多个cpp文件
- CMakeList配置之编译多个.cpp文件
- CMakeList配置之编译多个.cpp文件
- CMakeList配置之编译多个.cpp文件
- CMakeList配置之编译多个.cpp文件
- 多个cmake目录,根目录cmake写法
- cmake cpp构造项目
- Android Studio 3.0 Jni开发环境配置 cmake编译 多个C/C++文件添加配置
- Android studio 多个so库配置 ffmpeg库配置 cmake编译
- CMake编译
- Cmake编译
- 使用cmake gui 生成cpp-netlib vs2013项目并编译说明
- windows命令行(或linux)下用gcc/g++编译多个c/cpp文件
- leetcode 600. Non-negative Integers without Consecutive Ones
- HTML中的常用的空格总结
- 深度学习与计算机视觉系列(5)_反向传播与它的直观理解
- 进度条ProgressBar样式设计
- 各种网络相关的协议
- Cmake一次编译多个cpp
- JAVA安卓开发在MainActivity之前添加一个含有按钮页面跳转
- HTTP请求报文(请求行、请求头、请求体)
- 2017.7.7
- 博客模版
- quill自定义图片上传
- js实现canvas绘制的图形的拖动效果
- Codeforces Round #202 B:Color the Fence
- 一入侯门深似海,不破楼兰终不回