Modernize CMake usage #18258
Replies: 5 comments 6 replies
-
Transitioning to CMake's ExternalProject module to create a VisIt Superbuild option that builds VisIt and all of the TP libraries would be a great way to integrate all of these changes into a pretty clean CMake build system for VisIt. |
Beta Was this translation helpful? Give feedback.
-
We should have special topics meetings to chip away at this. There are a lot of lessons / choices we should consider from Conduit, Ascent, etc. TPLs are going to make a wide range of choices for the naming and style of find options and imported targets. BLT (https://github.com/llnl/blt) can also help here and is in use across many projects. It especially helps in the case that projects don't provide CONFIG targets. For exporting VisIt targets so they can be imported -- will folks actually use VisIt in that way (as a library?) Would this be the case we expect for plugin development? There are a lot of nuances to get these exports right. For example: I personally don't like GNUInstallDirs b/c only a handful of projects use it and I have had to use special logic to handle those projects. Example: https://github.com/Alpine-DAV/ascent/blob/a5b8c20ca8b1e9ff67dfc02421c496370ee1576a/src/cmake/thirdparty/SetupKokkos.cmake#L21 That said, this might be b/c I had to supporting a wide range of CMakes. I think the biggest class of changes and where we have the most choices are going to be related to TPL imports. Also, should we buy some copies of the modern cmake book to digest more? |
Beta Was this translation helpful? Give feedback.
-
I am expecting the export of VisIt targets to aid in plugin development against an installed VisIt, and hopefully do away with all the hacks and library path parsing we currently do. Would it help with libsim as well? |
Beta Was this translation helpful? Give feedback.
-
From our group discussion today:
|
Beta Was this translation helpful? Give feedback.
-
In terms of 'aliased' targets, did you have something specific in mind? I did some experimenting, first with Boxlib that doesn't have CMake config. I used the library and include information obtained from a I tried creating a target with a namespaced name Right now we use CMake variables a lot for our TP libs, like ${BOXLIB2D_LIBRARY}. |
Beta Was this translation helpful? Give feedback.
-
It's time VisIt's CMake usage was updated to modern CMake.
I have created a branch and draft PR (#18257) demonstrating some of the new principles.
Some on-line resources I've read in this regard:
CMake's guide to importing and exporting
A github gist post from user mbinna
A blog post on the subject from Pablo Arias
A CPPCon2017 Tutorial on Using Modern CMake
Daniel Pfeifer's talk at cppcon 2017
Some take-aways:
visit_
?else
orend
calls unless needed for clarity.Additional proposals and questions:
The CMake package export is at the bottom of the root CMakeLists.txt. It currently is minimal and may need customizations.
I created a temporary folder to house the files that got created with 'make install' on Windows as an example.
visitConfig.cmake
visitConfigVersion.cmake
visitTargets.cmake
visitTargets-release.cmake
Beta Was this translation helpful? Give feedback.
All reactions