現在、CMakeを使用してダイナミックライブラリを構築していますが、現在直面している問題は、ライブラリのファイルの追加に関連しています。私のプロジェクトの構造は次のとおりです。
----src
|
thrid_party---boost_1_50_0----boost
| --- | ----libs
| --- | ---- | --- filesystem
| --- | ---- | --- | ------src
私のCMakeLists.txtファイルはsrc
ディレクトリにあり、ファイルの内容は次のとおりです。
cmake_minimum_required( VERSION 2.6 )
project (temp)
#build the third party library
include_directories( ${irisimp_SOURCE_DIR}/../third_party/boost_1_50_0)
set (boost_path
${irisimp_SOURCE_DIR}/../third_party/boost_1_50_0/libs)
set (BOOST_LIST
${boost_path}/filesystem/src/codecvt_error_category.cpp
${boost_path}/filesystem/src/operations.cpp
${boost_path}/filesystem/src/path.cpp
${boost_path}/filesystem/src/path_traits.cpp
${boost_path}/filesystem/src/portability.cpp
${boost_path}/filesystem/src/unique_path.cpp
${boost_path}/filesystem/src/utf8_codecvt_facet.cpp
${boost_path}/filesystem/src/windows_file_codecvt.cpp
${boost_path}/filesystem/src/windows_file_codecvt.hpp
)
add_library ( boost SHARED ${BOOST_LIST})
このスクリプトの実行に問題はありませんが、出力のVisualStudio10プロジェクトには ${boost_path}/filesystem/src
フォルダー内のすべてのソースファイルが含まれていません。実際、windows_file_codecvt.cppのみが保持されます。したがって、このプロジェクトのコンパイルは失敗します。Visual Studio 10プロジェクトに、CMakeLists.txtで指示されているすべてのソースファイルを含めることができるようにするには、どうすればよいか疑問に思いました。ありがとうございます。