Skip to content

Commit 7ca4990

Browse files
committed
cmake: correct test linking
1 parent 2791fc7 commit 7ca4990

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@
1717
# gepetto-viewer If not, see
1818
# <http://www.gnu.org/licenses/>.
1919

20+
MACRO(ADD_TEST_CFLAGS target flag)
21+
SET_PROPERTY(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
22+
ENDMACRO(ADD_TEST_CFLAGS)
23+
2024
ADD_EXECUTABLE(testing test.cpp)
2125
TARGET_LINK_LIBRARIES(testing ${PROJECT_NAME})
2226

2327
ADD_UNIT_TEST(nodes nodes)
24-
TARGET_LINK_LIBRARIES(nodes ${PROJECT_NAME} ${Boost_LIBRARIES})
28+
ADD_TEST_CFLAGS(nodes "-DBOOST_TEST_DYN_LINK")
29+
TARGET_LINK_LIBRARIES(nodes ${PROJECT_NAME})
30+
TARGET_LINK_LIBRARIES(nodes ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})

tests/nodes.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
// <http://www.gnu.org/licenses/>.
1919

2020
#define BOOST_TEST_MODULE nodes
21-
#include <boost/test/included/unit_test.hpp>
21+
#include <boost/test/unit_test.hpp>
22+
#include <boost/utility/binary.hpp>
2223

2324
#include <gepetto/viewer/node.h>
2425
#include <gepetto/viewer/leaf-node-box.h>

0 commit comments

Comments
 (0)