query: tag:cmake

CMakeでは、親ディレクトリで設定された変数は、デフォルトでサブディレクトリから参照出来ます。しかし、逆にサブディレクトリ内で設定された変数は、そのままでは親ディレクトリ側から参照できません。
参照するためには、以下のようにget_directory_propertyを使って明示的に読み込む必要があります。

pre>>
get_directory_property(VAR1 DIRECTORY src DEFINITION FOO_SRCS)
<<--

posted by genki genki on Thu 12 Nov 2009 at 02:14 with 0 comments

cmakeをbuildするときはbootstrapファイルを実行しますが、prefixを指定する場合は以下の部分を書き換えます。

pre>>
cmake_default_prefix="c:/Program Files/CMake"
fi
else
cmake_default_prefix="/usr/local" # <= ここ
fi
<<--

あとは make install すればok.

posted by takiuchi takiuchi on Tue 27 Oct 2009 at 09:06 with 0 comments

CMakeList.txt file tends to have piles of options and seems very complicated.
For such situations, you can display configurable options by typing this command.

pre>>
% cmake -L
<<--

You will get very clear result. It's a preferable feature of CMake.

posted by takiuchi takiuchi on Mon 3 Aug 2009 at 07:04 with 0 comments