Minimale CMakeLists.txt für ROOT-Projekte

Dies ist ein minimales CMake-Beispiel für die Verwendung der ROOT-Bibliotheken in einem CMake-Projekt.

CMakeLists.txt
cmake_minimum_required(VERSION 3.10)

# Define the project name
project(myprogram)

# Find the required packages
find_package(ROOT REQUIRED)

# Add the executable target
add_executable(myprogram main.cpp)

target_include_directories(myprogram PUBLIC ${ROOT_INCLUDE_DIRS})

# Link the necessary libraries
target_link_libraries(myprogram ${ROOT_LIBRARIES} zmq)

Check out similar posts by category: ROOT, CMake