I am now building a dynamic library with CMake, and the problem I now meet with is related to adding files for the library. The structure of my project is as follows:
----src
|
thrid_party---boost_1_50_0----boost
| --- | ----libs
| --- | ---- | --- filesystem
| --- | ---- | --- | ------src
My CMakeLists.txt file is located in the src directory, and the contents of the file are as follows:
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})
I have no problem with running this script, however, the output Visual Studio 10 project does not contain all the source files in the ${boost_path}/filesystem/srcfolder. In fact only windows_file_codecvt.cpp is kept. Therefore, compiling this project will fail. I was wondering what I should do in order to make sure the Visual Studio 10 project can contain all the source files as instructed in the CMakeLists.txt.Thanks!
Try putting semicolons in between the paths like so:
If this doesn’t work, try
This might help debug where the problem lies.