2020-08-12 20:29:56 +02:00
|
|
|
# CMake ROOT usefile example
|
|
|
|
|
2018-05-01 17:18:27 +02:00
|
|
|
## [main]
|
2024-03-26 07:27:52 +01:00
|
|
|
cmake_minimum_required(VERSION 3.1...3.29)
|
2018-05-01 17:18:27 +02:00
|
|
|
|
|
|
|
project(RootUseFileExample LANGUAGES CXX)
|
|
|
|
|
2019-08-08 22:18:42 +02:00
|
|
|
find_package(ROOT 6.16 CONFIG REQUIRED)
|
2018-05-01 17:18:27 +02:00
|
|
|
|
2019-08-08 23:10:25 +02:00
|
|
|
## [core]
|
2019-08-08 22:18:42 +02:00
|
|
|
# Sets up global settings
|
2018-05-01 17:18:27 +02:00
|
|
|
include("${ROOT_USE_FILE}")
|
|
|
|
|
2019-08-08 22:18:42 +02:00
|
|
|
# This is required for ROOT < 6.16
|
|
|
|
# string(REPLACE "-L " "-L" ROOT_EXE_LINKER_FLAGS "${ROOT_EXE_LINKER_FLAGS}")
|
|
|
|
|
2018-05-01 17:18:27 +02:00
|
|
|
# This is required on if there is more than one flag (like on macOS)
|
|
|
|
separate_arguments(ROOT_EXE_LINKER_FLAGS)
|
|
|
|
|
|
|
|
add_executable(RootUseFileExample SimpleExample.cxx)
|
2020-08-04 00:16:52 +02:00
|
|
|
target_link_libraries(RootUseFileExample PUBLIC ${ROOT_LIBRARIES}
|
|
|
|
${ROOT_EXE_LINKER_FLAGS})
|
2019-08-08 23:10:25 +02:00
|
|
|
## [core]
|
2018-05-01 17:18:27 +02:00
|
|
|
|
|
|
|
## [main]
|
|
|
|
|
|
|
|
enable_testing()
|
|
|
|
add_test(NAME RootUseFileExample COMMAND RootUseFileExample)
|