Skip to content

Commit

Permalink
#125: Fix cmake target name conflicts between app and binding
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrepebay committed Feb 20, 2025
1 parent bc404d0 commit eace6ec
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ file(
nanobind_build_library(nanobind SHARED)

# Create the Python bindings for the module
nanobind_add_module(vttv ${PYTHON_BINDING_SRCS} tv.cc)
# small workaround here, use pyvttv target name to avoid conflict with binary executable
# target, called vttv as well; we want the python package to be called vttv too,
# thus the set_target_properties on OUTPUT_NAME.
nanobind_add_module(pyvttv ${PYTHON_BINDING_SRCS} tv.cc)
set_target_properties(${PYTHON_MODULE_TARGET} PROPERTIES OUTPUT_NAME "vttv")

# .. Link it to necessary libraries
target_link_libraries(vttv PUBLIC ${VT_TV_LIBRARY_NS} ${JSON_LIBRARY} ${FMT_LIBRARY})
target_link_libraries(pyvttv PUBLIC ${VT_TV_LIBRARY_NS} ${JSON_LIBRARY} ${FMT_LIBRARY})

vtk_module_autoinit(
TARGETS vttv
TARGETS pyvttv
MODULES ${VTK_LIBRARIES}
)

0 comments on commit eace6ec

Please sign in to comment.