I use a cmake generated makefile to compile a c++ file that depends on the boost filesystem library.
During the linking process I get the following error:
On linux CMake figures itself that boost_filesystem is linked against boost_system. Obviously you have to tell it explicitly on Mac:
find_package(Boost COMPONENTS system filesystem REQUIRED)
#...
target_link_libraries(mytarget
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
)
This is not an "answer" to the posted question, but an observation on my Ubuntu box.
To use the Boost libs, you have to explicitly write something like this:
find_package(Boost COMPONENTS regex system filesystem REQUIRED)
In addition, you need to link it this way:
target_link_libraries(binary
${Boost_FILESYSTEM_LIBRARY}
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
)
and the following way didn't work, at least for me:
target_link_libraries(binary regex system filesystem)
This follows what Maik says, but not only on Mac.