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.

  • 相关阅读:
    实验5 编写调试有多个段的程序
    实验四 [bx]和 loop 的使用
    实验三
    实验二
    第一章
    汇编语言第二章知识梳理
    实验一:查看CPU和内存,用机器指令和汇编指令编程
    实验9
    实验5
    实验4:
  • 原文地址:https://www.cnblogs.com/alexYuin/p/12775233.html
Copyright © 2011-2022 走看看