Hello everybody, I am currently trying to write a cmake script for my testcases. Previously i used a command like this:
g++ test.cpp -lboost_test_exec_monitor-mt -L/path/to/lib/ -lshark -I/path/to/include and everything worked fine. Now i'm using the following macro: MACRO( SHARK_ADD_TEST SRC NAME) ADD_EXECUTABLE( ${NAME} ${SRC} ) SET( LINK_LIBRARIES ${Boost_TEST_EXEC_MONITOR_LIBRARY} shark ) TARGET_LINK_LIBRARIES( ${NAME} ${LINK_LIBRARIES} ) ADD_TEST( ${NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Test/${NAME} ) ENDMACRO() SHARK_ADD_TEST( LinAlg/test.cpp LinAlg_test ) And this creates the following commands: /usr/bin/c++ -D_CRT_SECURE_NO_WARNINGS -DBOOST_ALL_DYN_LINK -I/path/to/include -o /some/path/test.o -c path/to/test/test.cpp /usr/bin/c++ /some/path/test.o -o /path/to/bin -rdynamic -Wl,-Bstatic -lboost_test_exec_monitor-mt -Wl,-Bdynamic /path/to/lib/libshark.so.2.3.0 -Wl,-rpath,/path/to/lib and the error: undefined reference to 'boost::unit_test::unit_test_main(bool (*)(),int,char**)' So cmake finds the correct library, but seems to link wrong. How can i fix that? Greetings, Oswin Krause _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake