Skip to content

Commit 390b99b

Browse files
committed
Fix windows builds
1 parent 1b989f3 commit 390b99b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/CMakeLists.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,16 @@ else()
5454
GTest::gtest
5555
GTest::gtest_main)
5656

57-
gtest_discover_tests(behaviortree_cpp_test)
57+
# gtest_discover_tests queries the test executable for available tests and registers them on ctest individually
58+
# On Windows it needs a little help to find the shared libraries
59+
if(WIN32)
60+
gtest_discover_tests(behaviortree_cpp_test
61+
DISCOVERY_MODE PRE_TEST
62+
DISCOVERY_ENVIRONMENT "PATH=$<TARGET_FILE_DIR:behaviortree_cpp_test>;$ENV{PATH}"
63+
)
64+
else()
65+
gtest_discover_tests(behaviortree_cpp_test)
66+
endif()
5867

5968
endif()
6069

0 commit comments

Comments
 (0)