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

    # Set the minimum version of CMake that can be used
    # To find the cmake version run
    # $ cmake --version
    cmake_minimum_required(VERSION 3.5)
    
    # Set a default build type if none was specified
    if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
      message("Setting build type to 'RelWithDebInfo' as none was specified.")
      set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
      # Set the possible values of build type for cmake-gui
      set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
        "MinSizeRel" "RelWithDebInfo")
    endif()
    
    # Set the project name
    project (build_type)
    
    # Add an executable
    add_executable(cmake_examples_build_type main.cpp)

    *

      set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
        "MinSizeRel" "RelWithDebInfo")

    - CMAKE_BUILD_TYPE This will be shown in GUI if user calling cmake-gui. CMAKE_BUILD_TYPE is a kept varible.

    In this demo, it offers 4 choices to user.

  • 相关阅读:
    找水王
    用户体验评价
    人件集阅读笔记01
    第十四周学习进度
    第十三周学习进度
    第十二周学习进度
    第十一周学习进度
    梦断代码阅读笔记03
    团队项目-第一阶段冲刺-10
    Shell按行读取文件的3种方法
  • 原文地址:https://www.cnblogs.com/alexYuin/p/12775233.html
Copyright © 2011-2022 走看看