From a236540e71d23d7f768d5e0df6dc2af2e3e2f33e Mon Sep 17 00:00:00 2001
From: Tobias Triffterer <tobias@ep1.ruhr-uni-bochum.de>
Date: Thu, 22 Apr 2021 18:58:26 +0200
Subject: [PATCH] Fix Building ROOT

The check if the compilation results from ROOT exist run during cmake
and not make, so in a fresh build directory it will always fail.

This removes these unfulfillable checks and creates the required
directories so the targets can be created.
---
 cmake/build-root-submodule.cmake | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/cmake/build-root-submodule.cmake b/cmake/build-root-submodule.cmake
index 0823924..8f9bb73 100644
--- a/cmake/build-root-submodule.cmake
+++ b/cmake/build-root-submodule.cmake
@@ -29,10 +29,6 @@ function(AddRootLibraryTarget)
   endif (NOT DEFINED ARLT_LIBNAME OR "${ARLT_LIBNAME}" EQUAL "")
   set(LIBNAME "${ARLT_LIBNAME}")
 
-  if (NOT EXISTS "${PROJECT_BINARY_DIR}/root_install/lib/lib${LIBNAME}.so.${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}")
-    message(FATAL_ERROR "Cannot find ROOT library ${LIBNAME} at ${PROJECT_BINARY_DIR}/root_install/lib/lib${LIBNAME}.so.${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}")
-  endif (NOT EXISTS "${PROJECT_BINARY_DIR}/root_install/lib/lib${LIBNAME}.so.${ROOT_MAJOR_VERSION}.${ROOT_MINOR_VERSION}.${ROOT_PATCH_VERSION}")
-
   add_library(ROOT::${LIBNAME} SHARED IMPORTED)
   set_target_properties(ROOT::${LIBNAME} PROPERTIES
     INTERFACE_COMPILE_FEATURES "cxx_std_${CMAKE_CXX_STANDARD}"
@@ -57,6 +53,10 @@ endfunction(AddRootLibraryTarget LIBNAME)
 
 include(ExternalProject)
 
+file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/root_build")
+file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/root_install/include")
+file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/root_install/lib")
+
 ExternalProject_Add(
   ROOTexternalProject
   SOURCE_DIR "${PROJECT_SOURCE_DIR}/submodules/root"
-- 
GitLab