I am developing customized Slicer by SlicerCAT. I added an button to toolbar of slicer mainwindow to allow toggling IGTLConnector. So I import vtkMRMLIGTLConnectorNode.h file of SlicerOpenIGTLink module in c++ code. But I encountered “No such file” error when compiling the source code:
I have added SlicerOpenIGTLink module in CMakelist.txt of SlicerCAT
set(extension_name "SlicerOpenIGTLink")
set(${extension_name}_SOURCE_DIR "${CMAKE_BINARY_DIR}/${extension_name}")
FetchContent_Populate(${extension_name}
SOURCE_DIR ${${extension_name}_SOURCE_DIR}
GIT_REPOSITORY /home/lizhixue/project/3D_Slicer/SlicerDependency/extensions/SlicerOpenIGTLink
GIT_TAG schcat
GIT_PROGRESS 1
QUIET
)
message(STATUS "Remote - ${extension_name} [OK]")
list(APPEND Slicer_EXTENSION_SOURCE_DIRS ${${extension_name}_SOURCE_DIR})
And it can be used in GUI and python code in my customized Slicer.
How can I made .h file of SlicerOpenIGTLink module be find when compiling c++ source code?