![]() # Note: To ensure compatibility with Cling, targets *must* be compiled using the # same C++ standard as ROOT was compiled with. find_package (ROOT REQUIRED COMPONENTS RIO Net ) include_directories ( $) ensures that properties such as required # include directories and C++ standard are propagated to our libraries or executables. cmake_minimum_required (VERSION 3.0 FATAL_ERROR ) project (event ) # Locate the ROOT package and define a number of useful targets and variables. # Otherwise, you must tell the build system where to look for ROOT, # for example by passing `-DROOT_DIR="/path/to/root/installation` at CMake configuration time. # Sourcing `thisroot.sh` already sets the required environment variables. # If ROOT is not installed in a default system location you need to tell CMake where to find it. # CMakeLists.txt for the "event" package. The following is an example of a project that creates a library and an executable file. However, prefer passing libraries as CMake targets whenever possible (see theįull example below). (the name of the component is the name of the library without any library prefix or suffix). For example, to add the RooStats library, you can specify it as an extra component You can force additional ROOT libraries in the ROOT_LIBRARIES variable using theĬommand. Adding additional libraries to ROOT_LIBRARIES The C++ standard used for ROOT appears for example among the flags listed by ![]() To ensure compatibility between ROOT’s C++ interpreter, Cling, and compiled code, yourĪpplication must be compiled with the same C++ standard with which ROOT was compiled. One CMake target per ROOT library is also available, e.g. Path to a CMake module, which makes use of the previous variables and loads modules with useful macros or functions such as ROOT_GENERATE_DICTIONARY. The actual list of libraries is composed using the COMPONENTS listed in the find_package(…) command.įull path for each of the ROOT libraries listed in COMPONENTS.įull path for each ROOT executable (rootcling, root, hadd, etc.). Include directories for the ROOT installation. The main interface is the CMake command find_package(…).Ĭalling find_package(ROOT) makes the following variables available: Variable ![]() You can integrate ROOT into a CMake based project. Adding additional libraries to ROOT_LIBRARIES.
0 Comments
Leave a Reply. |