correctly handle Tcl stub library if available

This commit is contained in:
Axel Kohlmeyer
2021-09-29 09:19:47 -04:00
parent b4307e2354
commit 3381f72b80

View File

@ -94,6 +94,11 @@ if(BUILD_SWIG_TCL)
if(NOT TCL_FOUND)
message(FATAL_ERROR "Tcl development headers and libraries are required")
endif()
find_package(TclStub)
if(TCL_STUB_LIBRARY)
target_compile_definitions(tcllammps PRIVATE USE_TCL_STUBS)
target_link_libraries(tcllammps PRIVATE ${TCL_STUB_LIBRARY})
endif()
target_include_directories(tcllammps PRIVATE ${TCL_INCLUDE_PATH})
swig_link_libraries(tcllammps PRIVATE lammps ${TCL_LIBRARY})
# build extended Tcl shell binary