• cmake语法学习


    Before diving into the code, here is the folders structure.

    ├── CMakeLists.txt [ Top most ]
    ├── subbinary
    │   ├── CMakeLists.txt [ subbinary ]
    │   └── main.cpp
    ├── sublibrary1
    │   ├── CMakeLists.txtsublibrary1 ]
    │   ├── include
    │   │   └── sublib1
    │   │   └── sublib1.h
    │   └── src
    │   └── sublib1.cpp
    └── sublibrary2
    ├── CMakeLists.txtsublibrary2 ]
    └── include
    └── sublib2
    └── sublib2.h

    *

    CMakeLists.txt [ subbinary ]

    To generate an execuatable. we have discussed before.

    *

    CMakeLists.txtsublibrary1 ]

    To generate an library. we have discussed before.

    *

    CMakeLists.txtsublibrary2 ]

    To generate an library. we have discussed before.

    ├── CMakeLists.txt [ Top most ]

    cmake_minimum_required (VERSION 3.5)
    
    project(subprojects)
    
    # Add sub directories
    add_subdirectory(sublibrary1)
    add_subdirectory(sublibrary2)
    add_subdirectory(subbinary)

    *

    add_subdirectory(sublibrary1)

    - sublibrary1 is the folder name. Even though we have a folder named "sublibrary1" here, there are totally 2 different things.

    - Question 1 :  Where to create the folder?

    Answer 1 : Most of us will "mkdir build", "cd build" and "cmake ..", so the absolute folder path will be "......./build/sublibrary1" .

    - Question 2 :What will the function do?

    Answer 2 : As far as I know,

    ------------- 1 Create a sub-folder in building folder;

    ------------- 2 Link the CMakelist.txt in "sublibrary1"; So you can not pass a arbitrary folder name here.

    That is all.

  • 相关阅读:
    vue 自定义全局按键修饰符
    Vue 过滤器
    v-if、v-show 指令
    其他内置函数
    python中序列化和反序列化
    jmeter图形化html报告核心指标介绍
    jmeter在linux系统下如何进行压力测试
    文件操作的其他方法
    文件处理操作
    内置函数reduce()
  • 原文地址:https://www.cnblogs.com/alexYuin/p/12778536.html
Copyright © 2020-2023  润新知