From 00b7fc12e266b510448a40aaec561f8556221bfa Mon Sep 17 00:00:00 2001 From: Vassil Vassilev Date: Mon, 12 Oct 2020 09:44:03 +0000 Subject: [PATCH] Properly add the compile definitions coming from ROOT. That will help us when creating C libraries. --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d82b032f..627fae211 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,14 @@ include(PytestBenchmark) #---Add ROOT include direcories and used compilation flags include_directories(${ROOT_INCLUDE_DIRS}) -add_definitions(${ROOT_CXX_FLAGS}) +string(REPLACE " " ";" ROOT_C_FLAGS_LIST ${ROOT_C_FLAGS}) +string(REPLACE " " ";" ROOT_CXX_FLAGS_LIST ${ROOT_CXX_FLAGS}) +foreach(C_COMPILE_FLAG ${ROOT_C_FLAGS_LIST}) + add_compile_options($<$:${C_COMPILE_FLAG}>) +endforeach() +foreach(CXX_COMPILE_FLAG ${ROOT_CXX_FLAGS_LIST}) + add_compile_options($<$:${CXX_COMPILE_FLAG}>) +endforeach() #---Include rootbench options include(RootBenchOptions)