CMakeはCross platform Makeの略。各OSにあわせてslnファイルやmakefileを作れる。

参照:http://fseek.exblog.jp/5637217

CMakeLists.txtの書き方

インストール

使い方

C:\work\cmake-2.6.2>cd Example

C:\work\cmake-2.6.2\Example>dir
2008/09/24  14:46               500 CMakeLists.txt
2008/11/14  15:37    <DIR>          Demo
2008/11/14  15:37    <DIR>          Hello
C:\work\cmake-2.6.2\Example>type CMakeLists.txt
# The name of our project is "HELLO".  CMakeLists files in this project can
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.
project (HELLO)

# Recurse into the "Hello" and "Demo" subdirectories.  This does not actually
# cause another cmake executable to run.  The same process will walk through
# the project's entire directory structure.
add_subdirectory (Hello)
add_subdirectory (Demo)
C:\work\cmake-2.6.2\Example>..\..\cmake\bin\cmake.exe .
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.6)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: C:/work/cmake-2.6.2/Example
C:\work\cmake-2.6.2\Example>dir
2008/11/14  15:39            19,889 ALL_BUILD.vcproj
2008/11/14  15:39            12,427 CMakeCache.txt
2008/11/14  15:39    <DIR>          CMakeFiles
2008/09/24  14:46               500 CMakeLists.txt
2008/11/14  15:39             1,740 cmake_install.cmake
2008/11/14  15:41    <DIR>          Demo
2008/11/14  15:40    <DIR>          Hello
2008/11/14  15:41           191,488 HELLO.ncb
2008/11/14  15:39             4,289 HELLO.sln
2008/11/14  15:39            18,292 ZERO_CHECK.vcproj

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2014-06-17 (火) 21:50:48