Hi all,<br><br>I have been trying to compile a very simple example with cmake (2.8.5) and boost, and I can't get what I am doing wrong...<br><br>CMakeLists.txt<br>----------------------<br><br>cmake_minimum_required(VERSION 2.6)<br>
<br>project(ReadGraph)<br><br>find_package(Boost 1.46 COMPONENTS graph regex )<br><br>link_directories(${Boost_LIBRARY_DIRS})<br>include_directories(BEFORE ${Boost_INCLUDE_DIRS})<br><br>add_executable(ReadGraph ReadGraph.cpp)<br>
target_link_libraries(ReadGraph ${Boost_LIBRARIES} )<br># target_link_libraries(ReadGraph boost_graph boost_regex )<br><br><br>ReadGraph.cpp<br>----------------------<br>// <a href="http://www.boost.org/doc/libs/1_37_0/libs/graph/doc/read_graphviz.html">http://www.boost.org/doc/libs/1_37_0/libs/graph/doc/read_graphviz.html</a><br>
#include <iostream><br>#include <string><br>#include <fstream><br><br>#include <boost/graph/adjacency_list.hpp><br>#include <boost/graph/graphviz.hpp><br><br>int main(int , char* [])<br>{<br>
return 0;<br>}<br><br>Here is what the error I get when trying to compile:<br><br>$ make<br>/usr/bin/cmake -H/home/ajg23/GITROOT/BGLCMakeQuestion -B/home/ajg23/GITROOT/BGLCMakeQuestion/build --check-build-system CMakeFiles/Makefile.cmake 0<br>
/usr/bin/cmake -E cmake_progress_start /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles/progress.marks<br>make -f CMakeFiles/Makefile2 all<br>make[1]: Entering directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
make -f CMakeFiles/ReadGraph.dir/build.make CMakeFiles/ReadGraph.dir/depend<br>make[2]: Entering directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>cd /home/ajg23/GITROOT/BGLCMakeQuestion/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/ajg23/GITROOT/BGLCMakeQuestion /home/ajg23/GITROOT/BGLCMakeQuestion /home/ajg23/GITROOT/BGLCMakeQuestion/build /home/ajg23/GITROOT/BGLCMakeQuestion/build /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles/ReadGraph.dir/DependInfo.cmake --color=<br>
make[2]: Leaving directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>make -f CMakeFiles/ReadGraph.dir/build.make CMakeFiles/ReadGraph.dir/build<br>make[2]: Entering directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>
/usr/bin/cmake -E cmake_progress_report /home/ajg23/GITROOT/BGLCMakeQuestion/build/CMakeFiles 1<br>[100%] Building CXX object CMakeFiles/ReadGraph.dir/ReadGraph.cpp.o<br>/usr/bin/c++ -o CMakeFiles/ReadGraph.dir/ReadGraph.cpp.o -c /home/ajg23/GITROOT/BGLCMakeQuestion/ReadGraph.cpp<br>
make[2]: *** No rule to make target `/usr/lib/libboost_graph-mt.so', needed by `ReadGraph'. Stop.<br>make[2]: Leaving directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>make[1]: *** [CMakeFiles/ReadGraph.dir/all] Error 2<br>
make[1]: Leaving directory `/home/ajg23/GITROOT/BGLCMakeQuestion/build'<br>make: *** [all] Error 2<br><br><br>If I don't use ${Boost_LIBRARIES} but explicitly the corresponding libraries (i.e. boost_graph and boost_regex) it compiles without any problem...<br>
<br>Can anyone give me a hand on this one? Is this a bug?<br><br>Note that I have also been trying with the master and the next version of cmake, same thing...<br><br>Thanks,<br>Arnaud<br>