Skip to content

CMake Cleanup, master branch (2019.10.30.)

Before updating the build of atlas/atlasexternals (and hence atlas/athena) to use this new project, I wanted to clean its CMake configuration a bit. So here it is...

First off, I removed a bunch of files from the repository that are no longer needed. They were necessary while GeoGenericFunctions and GeoModelKernel lived in their separate repositories, but they are no longer needed.

I modified the CMakeLists.txt files in the two "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 some new "modules" 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 both 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 both libraries will have.
    • Note that I also incremented the patch version number to reflect that the build was changed.
  • I made some larger modifications to how the libraries are installed/exported. The project only uses a single "export name" now (GeoModelCore-export), which made the hand-written GeoModelCoreConfig.cmake file unnecessary. As I just rely on install(EXPORT) to set up that file for us.
    • I also added code that would generate a GeoModelCoreConfigVersion.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(GeoModelCore) 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 GeoModelCore 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.

Please have a look! If you're happy with this setup, we should merge this in, and also tag the project as 1.2.1 or something similar. (I'd prefer to use tag names in the ATLAS offline code for picking up versions of this project instead of just using Git hashes...)

Edited by Attila Krasznahorkay

Merge request reports