2020-08-12 20:29:56 +02:00
|
|
|
# CMake ROOT simple example
|
|
|
|
|
2018-03-28 22:48:45 +02:00
|
|
|
## [main]
|
2021-07-14 18:09:06 +02:00
|
|
|
cmake_minimum_required(VERSION 3.1...3.21)
|
2018-03-28 20:50:38 +02:00
|
|
|
|
2018-03-28 22:48:45 +02:00
|
|
|
project(RootSimpleExample LANGUAGES CXX)
|
2018-03-28 20:50:38 +02:00
|
|
|
|
2019-08-08 22:18:42 +02:00
|
|
|
# Finding the ROOT package
|
2018-03-28 22:48:45 +02:00
|
|
|
## [find_package]
|
2019-08-08 22:18:42 +02:00
|
|
|
find_package(ROOT 6.16 CONFIG REQUIRED)
|
2018-03-28 22:48:45 +02:00
|
|
|
## [find_package]
|
2018-03-28 20:50:38 +02:00
|
|
|
|
2019-08-08 22:18:42 +02:00
|
|
|
# Adding an executable program and linking to needed ROOT libraries
|
2018-03-28 22:48:45 +02:00
|
|
|
## [add_and_link]
|
2018-03-29 12:27:23 +02:00
|
|
|
add_executable(RootSimpleExample SimpleExample.cxx)
|
2019-08-08 22:18:42 +02:00
|
|
|
target_link_libraries(RootSimpleExample PUBLIC ROOT::Physics)
|
2018-03-28 22:48:45 +02:00
|
|
|
## [add_and_link]
|
|
|
|
|
|
|
|
## [main]
|
2018-03-28 20:50:38 +02:00
|
|
|
|
|
|
|
enable_testing()
|
2018-03-29 12:27:23 +02:00
|
|
|
add_test(NAME RootSimpleExample COMMAND RootSimpleExample)
|