Skip to content

CMake Cleanup, master branch (2019.10.30.)

This is a sibling to GeoModelCore!1 (merged). It makes the same sort of updates in this package as that MR does to GeoModelCore.

I modified the CMakeLists.txt files in the "package directories" to only deal with the setup of the libraries that live in those packages. Everything else I moved in the the main projects CMakeLists.txt file, and into a new "module" under the cmake/ directory.

Here are some specific things that I changed:

  • I liked the initiative to set specific VERSION and SOVERSION properties on the libraries. But instead of doing that in a very hardcoded way separately for all libraries, I thought it would make sense to just use the "project version" as the versions of those libraries. So in this setup whatever version number is set in the project(...) call in the main CMakeLists.txt file, is the version which all libraries will have.
    • Note that I also modified the project version number to be in sync with the latest current tag of the project. Though it may make sense to increase it to 1.3.1 now instead...
  • I made some larger modifications to how the libraries are installed/exported. The project only uses a single "export name" now (GeoModelIO-export), which allowed me to implement the GeoModelIOConfig.cmake file in a bit smarter way now.
    • I also added code that would generate a GeoModelIOConfigVersion.cmake file. With the setup that only major versions of the library are compatible with each other. (As long as the user doesn't specify any version in find_package(GeoModelIO) this will not make any difference. But in case they do, it will prevent the usage of let's say version 2.X.Y of GeoModelIO when the user asks for version 1.X.Y.)
    • Note that in the ATLAS code we don't actually rely on these generated files to set up our builds against these libraries, they are just meant for users outside of the ATLAS offline software.
  • I've put together a small CPack configuration for the project. To be able to build TGZ/RPM/DEB packages from the repository in a simple way.
    • Again, the ATLAS build system is not going to make use of this packaging setup, but it's still nice to have it for possible standalone use cases.

Before merging this in, GeoModelCore!1 (merged) should be merged first.

Edited by Attila Krasznahorkay

Merge request reports