<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Fantastic work Ben. One question below.</div><div dir="ltr"><br></div><div dir="ltr">Den mån 29 okt. 2018 17:07Ben Boeckel <<a href="mailto:ben.boeckel@kitware.com">ben.boeckel@kitware.com</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I've gotten the new module system to a point that I'd like to open up<br>
testing to other developers. It's not 100% complete (see the known<br>
issues listing below), but it's pretty close. I'd highly recommend using<br>
a new build tree for building the branch.<br>
<br>
Notes for WIP things on the branch:<br>
<br>
- There's a hard-coded list of "don't build this" in CMakeLists.txt<br>
currently just for my convenience. Feel free to edit the<br>
`REJECT_MODULES` argument list as needed for your machine(s).<br>
<br>
Overview of changes:<br>
<br>
- Instead of `module.cmake`, there are `vtk.module` and `vtk.kit`<br>
files. These are basically CMake argument lists, but no variable<br>
expansion is allowed. If there are optional dependencies, they must<br>
be private dependencies. Optional public dependencies indicate that<br>
a new module should be made instead.<br>
<br>
- Modules may now be "rejected" and never built. This turns off<br>
*dependent* modules. If a module is required and also has a rejected<br>
module as a dependency, an error occurs.<br>
<br>
- Minimum CMake is still 3.3, but kit support requires CMake 3.12+ for<br>
object library features.<br>
<br>
- There are no more `vtk_mpi_link` or `vtk_opengl_link` "magic"<br>
functions. Instead, just depend on the `VTK::mpi` and `VTK::opengl`<br>
modules.<br>
<br>
- Third party modules now declare whether they support external copies<br>
or not (i.e., no more useless `VTK_USE_SYSTEM_kwsys` variable). See<br>
the `ThirdParty` directory for various examples. Other third parties<br>
only support external copies (e.g., `VTK::mpi` and `VTK::opengl`).<br>
<br>
- Imported targets are now preferred for `find_package` callers. Third<br>
party packages warn about this usage, but others do not. There is<br>
also the `vtk_module_find_package` call which also adds required<br>
`find_package` calls to the `vtk-config.cmake` file for external<br>
consumers (only necessary when using imported targets).<br>
<br>
- Module names now look like `VTK::CommonCore`. This is a target name<br>
which can be used anywhere, within or outside of the VTK source<br>
tree. Non-module projects now do:<br>
<br>
```cmake<br>
# Find VTK.<br>
find_package(VTK REQUIRED COMPONENTS CommonCore)<br>
# Make two programs.<br>
add_executable(myexe1 myexe1.c)<br>
add_executable(myexe2 myexe2.c)<br>
# Add include directories, link line, compile definitions, etc.<br>
# necessary to use VTK::CommonCore.<br>
target_link_libraries(myexe1 PRIVATE VTK::CommonCore)<br>
target_link_libraries(myexe2 PRIVATE VTK::CommonCore)<br>
# Add VTK_AUTOINIT defines to the targets.<br>
vtk_module_autoinit(TARGETS myexe1 myexe2 MODULES VTK::CommonCore)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Can this not be brought in automatically via the target's interface definitions?</div><div dir="auto"><br></div><div dir="auto">With the current setup, I'm getting them via ${VTK_DEFINITIONS} I think.</div><div dir="auto"><br></div><div dir="auto">Would be nice to avoid the repeated target name.</div><div dir="auto"><br></div><div dir="auto">Elvis</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
```<br>
<br>
- To add requirements to a module, the module system offers some<br>
functions in lieu of CMake's `target_*`. This is in order to<br>
properly support kits (the `CommonCore` target is just an<br>
`INTERFACE` library in this case and `PRIVATE` link libraries need<br>
copied onto the containing kit). The functions:<br>
* `vtk_module_compile_options`<br>
* `vtk_module_definitions`<br>
* `vtk_module_include`<br>
* `vtk_module_link`<br>
* `vtk_module_link_options` (depends on `target_link_options` in<br>
CMake 3.13+)<br>
<br>
It is currently based on `master` as of a week ago, but I'll probably<br>
rebase again this week.<br>
<br>
Please file issues found with the branch on my fork of VTK:<br>
<br>
<a href="https://gitlab.kitware.com/ben.boeckel/vtk/issues" rel="noreferrer noreferrer" target="_blank">https://gitlab.kitware.com/ben.boeckel/vtk/issues</a><br>
<br>
to make things easier to track. Since Gitlab doesn't support MRs between<br>
sibling forks (yet), please attach patches to issues if you have a fix.<br>
<br>
Known issues:<br>
<br>
- Running generated Java wrappers needs some attention. Missing<br>
symbols (from Java code?) happen when running the tests.<br>
- Windows support (there are some `:` characters left in filenames<br>
yet).<br>
<br>
Unimplemented:<br>
<br>
- Remote modules (conceptually the same as before, but there are no<br>
remote modules that have been ported right now)<br>
- `OPTIONAL_PYTHON_LINK` magic keyword. This can now just be supported<br>
in the `VTK::Python` module, but has not been implemented.<br>
<br>
Untested:<br>
<br>
- Multi-config generators (e.g., Xcode and Visual Studio).<br>
- Mobile device support.<br>
<br>
Thanks,<br>
<br>
--Ben<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" rel="noreferrer noreferrer" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://public.kitware.com/mailman/listinfo/vtk-developers" rel="noreferrer noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
</blockquote></div></div></div>