Programing/Tool/CMake/Guides/Tutorial のバックアップ(No.1)



CMake Tutorialの簡易翻訳

はじめに

Step1.基本

最も基本的なプロジェクトは、ソースコードから実行ファイルをビルドします。
単純なプロジェクトの場合、必要なのは3行の CMakeLists.txt ファイルのみです。
このファイルがチュートリアルの出発点になります。
次のような CMakeLists.txt ファイルを Setp1 ディレクトリに作成します。

  1. cmake_minimum_required(VERSION 3.10)
  2.  
  3. # プロジェクト名を指定
  4. project(Tutorial)
  5.  
  6. # 実行ファイルを追加
  7. add_executable(Tutorial tutorial.cxx)

Note that this example uses lower case commands in the CMakeLists.txt file. Upper, lower, and mixed case commands are supported by CMake. The source code for tutorial.cxx is provided in the Step1 directory and can be used to compute the square root of a number.