Cetbuildtools user guide - Cetbuildtools cmake modules - Defining products in the CET build environment - Using the example - Buildtool script

Using the example

cetbuildtools includes an example package: $CETBUILDTOOLS_DIR/example/ToyCmake
This example may be useful when creating a brand new package that will use cmake and cetbuildtools.

To get and run ToyCmake according to CET best practices:
  • setup your ups environment
  • ups list -aK+ cetbuildtools
  • setup cetbuildtools <version> - ususally the most recent
  • mkdir -p /some/path/to/devel/code /some/path/to/devel/build /some/path/to/devel/products
  • cd /some/path/to/devel/code
  • cp -pr $CETBUILDTOOLS_DIR/example/ToyCmake .
  • cd /some/path/to/devel/build
  • source /some/path/to/devel/code/ToyCmake/ups/setup_for_development -p
  • -- where setup for development can be -d (debug) or -p (profile)
  • -- you may also specify -o (optimized), but CET recommends profile
  • -- note that setup_for_development tells you how to run cmake
  • env CC=cc CXX=c++ FC=gfortran cmake -DCMAKE_INSTALL_PREFIX=/some/path/to/devel/products -DCMAKE_BUILD_TYPE=$CETPKG_TYPE $CETPKG_SOURCE
  • make
  • make test
  • make install
The last few steps can be simplified greatly by using the buildtool script
  • source /some/path/to/devel/code/ToyCmake/ups/setup_for_development -p
  • buildtool -I /some/path/to/devel/products -A