CMake Linking RDataFrame

Hi,

I typically don’t use the include(${ROOT_USE_FILE}) as many project have executable that don’t require ROOT. With and without this call I get the following error during compilation:

$ make
-- Configuring done
CMake Error at CMakeLists.txt:7 (add_executable):
  Target "my_exec" links to target "Vdt::Vdt" but the target was not found.
  Perhaps a find_package() call is missing for an IMPORTED target, or an
  ALIAS target is missing?


-- Generating done
-- Build files have been written to: forum/build
make: *** [cmake_check_build_system] Error 1

Here is the example I’m now building:

cmake_minimum_required(VERSION 3.6 FATAL_ERROR)

find_package(ROOT 6.14 REQUIRED COMPONENTS ROOTDataFrame)

include(${ROOT_USE_FILE})

add_executable(my_exec my_exec.cxx)
target_link_libraries(my_exec PUBLIC ROOT::ROOTDataFrame)

and

#include <ROOT/RDataFrame.hxx>                                                                           

int main(int argc, char* argv[]) {                                                                       
   return 0;                                                                                             
}