zoukankan      html  css  js  c++  java
  • cmake语法学习

    cmake_minimum_required(VERSION 3.5)
    
    project(hello_library)
    
    ############################################################
    # Create a library
    ############################################################
    
    #Generate the static library from the library sources
    add_library(hello_library STATIC
        src/Hello.cpp
    )
    
    target_include_directories(hello_library
        PUBLIC 
            ${PROJECT_SOURCE_DIR}/include
    )
    
    
    ############################################################
    # Create an executable
    ############################################################
    
    # Add an executable with the above sources
    add_executable(hello_binary 
        src/main.cpp
    )
    
    # link the new hello_library target with the hello_binary target
    target_link_libraries( hello_binary
        PRIVATE 
            hello_library
    )

    *

    add_library(hello_library STATIC

             src/Hello.cpp

    )

    - hello_library is the library file name

    - STATIC must be upper case, and it means to generate a static library. The suffix is *.o in Ubuntu.

    - src/Hello.cpp

  • 相关阅读:
    定时器
    js中script的上下放置区别 , Dom的增删改创建
    函数声明与应用
    常规选择器
    表格的制作
    流程控制
    For循环
    洛谷P1419寻找段落
    洛谷P1021邮票面值设计
    洛谷P3119草鉴定
  • 原文地址:https://www.cnblogs.com/alexYuin/p/12773341.html
Copyright © 2011-2022 走看看