CMake: fix linking error in test function when linking Python statically

This commit is contained in:
wmayer
2023-01-09 11:41:22 +01:00
parent e42f46a47b
commit d159b97cae

View File

@@ -4,4 +4,17 @@ add_executable(
tst_Tools.cpp
)
target_link_libraries(Tests_Tools_run gtest gtest_main ${Google_Tests_LIBS} FreeCADBase)
set (Tests_Tools_LIBS
gtest
gtest_main
${Google_Tests_LIBS}
FreeCADBase
)
if(NOT BUILD_DYNAMIC_LINK_PYTHON)
list(APPEND Tests_Tools_LIBS
${PYTHON_LIBRARIES}
)
endif()
target_link_libraries(Tests_Tools_run ${Tests_Tools_LIBS})