<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt'>
<p>Thank you for your help Robert. The suggestion did get me further along and I was able to build a static library. But I still had trouble with ParaView and shared libraries.</p>
<p>My main objective was to be able to have a Git repo of my code which was independent of the VTK Git repo. I learned from your suggestion that this would be called an External Module, which led me to <a href="https://www.vtk.org/Wiki/VTK/Module_Development,">https://www.vtk.org/Wiki/VTK/Module_Development,</a> and the following note:</p>
<h2><span id="External_modules" class="mw-headline" style="font-size: 12pt;">External modules</span></h2>
<ul>
<li>If you include a copy of the VTK source inside your project, you can simply add new directories with module.cmake and CMakeLists.txt files in them.</li>
</ul>
<p>So I am now able to include my module in the VTK build without touching any of the VTK source code using the above approach. I also figured out that I need to enable my module in CMake under Advanced settings when Configuring ParaView build.</p>
<p>So, now I can build static VTK libraries to use in my standalone exe, and shared VTK libs for use as ParaView plugin. I use the XML based plugin definition which I manually load with ParaView plugin manager.</p>
<p>Thank you</p>
<p>Kamyar</p>
<p><br /></p>
<p>On 2018-08-06 22:32, Robert Maynard wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">You will need to include the vtkExternalModuleMacros.cmake file for<br /> this approach to work. Something like the following should allow<br /> vtk_module_library to be a valid command:<br /> <br /> set(CMAKE_MODULE_PATH<br />     ${CMAKE_MODULE_PATH}<br />     ${VTK_CMAKE_DIR}<br />     ${CMAKE_CURRENT_SOURCE_DIR}/cmake<br />     )<br /> include(vtkExternalModuleMacros)<br /> On Mon, Aug 6, 2018 at 1:42 PM Kamyar <<a href="mailto:kgh5@raymak.com">kgh5@raymak.com</a>> wrote:
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><br /> I have a couple of custom VTK filters. They are hacked into the VTK sources by adding them to the CMakeList of the existing General Filters module and built along with the entire VTK library. I use the resulting filters both in Paraview (shared libs), and in a little executable (static libs).<br /> <br /> I assume I should be able to make VTK as is, then build my filters separately into a new library. But I can't figure out how to set up the CMakelist so the library can be built separately. Every example I can find for custom VTK filters builds them directly into an executable, not a library.<br /> <br /> Am I supposed to be doing this as a VTK Remote Module? But there is nothing published in a journal, and I am not trying to share it with anyone.<br /> <br /> Am I supposed to put them in as a Third-party submodule? But then they would still build along with the full VTK build.<br /> <br /> Here is the attempted CMakeList, which produces the error: "Unknown CMake command "vtk_module_library".<br /> <br /> find_package(VTK REQUIRED)<br /> include(${VTK_USE_FILE})<br /> <br /> set(Module_SRCS<br /> ModelReduce.cxx<br /> )<br /> <br /> configure_file(<br /> ${CMAKE_CURRENT_SOURCE_DIR}/ModelReduceExport.h.in<br /> ${CMAKE_CURRENT_BINARY_DIR}/ModelReduceExport.h<br /> )<br /> <br /> vtk_module_library(vtkModelReduce ${Module_SRCS})<br /> <br /> _______________________________________________<br /> Powered by <a href="http://www.kitware.com" target="_blank" rel="noopener noreferrer">www.kitware.com</a><br /> <br /> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank" rel="noopener noreferrer">http://www.kitware.com/opensource/opensource.html</a><br /> <br /> Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank" rel="noopener noreferrer">http://www.vtk.org/Wiki/VTK_FAQ</a><br /> <br /> Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank" rel="noopener noreferrer">http://markmail.org/search/?q=vtkusers</a><br /> <br /> Follow this link to subscribe/unsubscribe:<br /> <a href="https://public.kitware.com/mailman/listinfo/vtkusers" target="_blank" rel="noopener noreferrer">https://public.kitware.com/mailman/listinfo/vtkusers</a></blockquote>
</div>
</blockquote>
<p><br /></p>

</body></html>