Project

General

Profile

mrb User Guide

mrb Reference Guide

CMakeLists.txt

Depending on the release of cetbuildtools, the top level CMakeLists.txt file for your package requires one or two lines specifically for mrb.

cetbuildtools v4_02_00 and later

As of cetbuildtools v4_02_00, cet_cmake_env calls set_install_root for you.
  • project(project_name)
  • this line should be near the top
  • For example:
    # use cmake 2.8 or later
    cmake_minimum_required (VERSION 2.8)
    
    project(larcore)
    

versions of cetbuildtools before v4_02_00

If you are using older releases of cetbuildtools, you must define the project and call set_install_root.
  • project(project_name)
  • this line should be near the top
  • set_install_root()
  • this line must come after
    include(CetCMakeEnv)
    cet_cmake_env()
    
  • For example:
    # use cmake 2.8 or later
    cmake_minimum_required (VERSION 2.8)
    
    project(larcore)
    
    # cetbuildtools contains our cmake modules
    SET ( CETBUILDTOOLS_VERSION $ENV{CETBUILDTOOLS_VERSION} )
    IF (NOT CETBUILDTOOLS_VERSION)
        MESSAGE (FATAL_ERROR "ERROR: setup cetbuildtools to get the cmake modules")
    ENDIF()
    
    set(CMAKE_MODULE_PATH $ENV{ART_DIR}/Modules
                          $ENV{CETBUILDTOOLS_DIR}/Modules
                          ${CMAKE_MODULE_PATH})
    
    include(CetCMakeEnv)
    cet_cmake_env()
    
    set_install_root()
    

mrb newProduct

The mrb newProduct command will create a product skeleton for you.

normal skeleton

cd $MRB_SOURCE
mrb newProduct [-c] <product name>

The skeleton will create a <product name> with 3 subdirectories: <product name>, test, and ups.
Add source code, headers, and fhicl files to <product name>/<product name>.
Add tests to <product name>/test.
Edit <product name>/ups/product_deps. Check the product version. Add dependencies.

skeleton for a null flavored product

Sometimes you need a product that will only install scripts or perhaps fhicl files. There is nothing to compile and no dependence on any flavored package. In these cases, you want a "null flavored" product.

cd $MRB_SOURCE
mrb newProduct [-c] -n <product name>