4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[CMake] CMakeLists.txtが存在するパスを取得

Posted at

CMakeメモ。処理中のCMakeLists.txtが存在するパスを取得する。

${CMAKE_CURRENT_SOURCE_DIR}

他のパスを取得する変数は階層を持つ複雑なビルドにしか使わないと思いますが、必要な場合は以下などを参照して下さい。

CMake : out-of-sourceビルドで幸せになる - Qiita #ソースツリーとビルドツリーに関連する変数一覧
cmake-variables(7) — CMake 3.5.2 Documentation

参考

How do I specify relative paths in CMAKE? - Stack Overflow

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?