Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  28 May 2019, Stefan Ritt, Info, MIDAS switching to Cmake 
    Reply  28 May 2019, Konstantin Olchanski, Info, MIDAS switching to Cmake 
       Reply  28 May 2019, Stefan Ritt, Info, MIDAS switching to Cmake 
          Reply  29 May 2019, Stefan Ritt, Info, MIDAS switching to Cmake 
       Reply  03 Jun 2019, Konstantin Olchanski, Info, MIDAS switching to Cmake 
          Reply  05 Jun 2019, Konstantin Olchanski, Info, MIDAS switching to Cmake 
             Reply  17 Jun 2019, Konstantin Olchanski, Info, MIDAS switching to Cmake 
                Reply  17 Jun 2019, Konstantin Olchanski, Info, MIDAS switching to Cmake 
                Reply  17 Jun 2019, Stefan Ritt, Info, MIDAS switching to Cmake 
                   Reply  18 Jun 2019, Konstantin Olchanski, Info, MIDAS switching to Cmake 
Message ID: 1553     Entry time: 17 Jun 2019     In reply to: 1541     Reply to this: 1557   1558
Author: Konstantin Olchanski 
Topic: Info 
Subject: MIDAS switching to Cmake 
> Status update on the cmake conversion:

It looks like cmake cannot do several things we need for building midas.

- it looks like cmake does not support bare object files as 1st class build targets.

We build at least two bare object files: mfe.o and mana.o for use by frontends and analyzers (and I am about
to add one more for the manalyzer). They all contain main() functions and cannot be in libmidas.a.

Stefan & co managed to kludge cmake to build mfe.o but so far I have been unable to figure out how to tell cmake
to actually use it for linking. Replacing "mfe" for -llibmfe in target_include_libraries() with "mfe.o" yields -llibmfe.o, clearly
they do not support linking to bare library object files.

So to avoid fighting cmake, libmfe.a and libmana.a are here to stay.

- it looks like cmake does not like building variant executables and object files, i.e. "with ROOT" and "without ROOT".

I need to set "-DHAVE_ROOT" for building "with ROOT" and unset it via remove_definitions() for building "without ROOT",
but remove_definitions() and add_definitions() do not work on a per-target basis, instead they operate
per-directory and per-project.

In midas, we build mlogger without ROOT (to avoid tangling it with the ROOT RPATH and ROOT shared libraries),
but if ROOT is present, we build rmlogger "with ROOT support". Same for the analyzer (mana.o and rmana.o).

For now we have this:
- mana.o is built with ROOT if ROOT is detected
- rmana.o is not built
- rmlogger is not built (not clear why)

K.O.
ELOG V3.1.4-2e1708b5