简单的 ROOT 工程

这是使用目标系统,但不使用字典的最小 ROOT 项目示例。

examples/root-simple/CMakeLists.txt

cmake_minimum_required(VERSION 3.1...3.21)

project(RootSimpleExample LANGUAGES CXX)

# Finding the ROOT package
find_package(ROOT 6.16 CONFIG REQUIRED)

# Adding an executable program and linking to needed ROOT libraries
add_executable(RootSimpleExample SimpleExample.cxx)
target_link_libraries(RootSimpleExample PUBLIC ROOT::Physics)

examples/root-simple/SimpleExample.cxx

#include <TLorentzVector.h>

int main() {
    TLorentzVector v(1,2,3,4);
    v.Print();
    return 0;
}

results matching ""

    No results matching ""