diff --git a/graf2d/asimage/src/libAfterImage/CMakeLists.txt b/graf2d/asimage/src/libAfterImage/CMakeLists.txt index 92f5f1cfe8632..410754e7a2160 100644 --- a/graf2d/asimage/src/libAfterImage/CMakeLists.txt +++ b/graf2d/asimage/src/libAfterImage/CMakeLists.txt @@ -27,11 +27,11 @@ set(FREETYPE_INCLUDE_DIR "" CACHE PATH "Path to Freetype include dir") set(ZLIB_INCLUDE_DIR "" CACHE PATH "Path to zlib include dir") if(NOT EXISTS "${FREETYPE_INCLUDE_DIR}/ft2build.h") - message(ERROR "Can't find ft2build.h in ${FREETYPE_INCLUDE_DIR}") + message(SEND_ERROR "Can't find ft2build.h in ${FREETYPE_INCLUDE_DIR}") endif() if(NOT EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") - message(ERROR "Can't find zlib.h in ${ZLIB_INCLUDE_DIR}") + message(SEND_ERROR "Can't find zlib.h in ${ZLIB_INCLUDE_DIR}") endif() INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR}) diff --git a/roofit/roofit/test/vectorisedPDFs/CMakeLists.txt b/roofit/roofit/test/vectorisedPDFs/CMakeLists.txt index 6ed546a26ad67..c17ef68652074 100644 --- a/roofit/roofit/test/vectorisedPDFs/CMakeLists.txt +++ b/roofit/roofit/test/vectorisedPDFs/CMakeLists.txt @@ -48,7 +48,7 @@ ROOT_ADD_GTEST(testCBShape testCBShape.cxx LIBRARIES VectorisedPDFTests) ROOT_ADD_GTEST(testGamma testGamma.cxx LIBRARIES VectorisedPDFTests) -if(ROOT_mathmore_FOUND) +if(mathmore) ROOT_ADD_GTEST(testLegendre testLegendre.cxx LIBRARIES VectorisedPDFTests ROOT::RooFitMore) endif() diff --git a/roottest/CMakeLists.txt b/roottest/CMakeLists.txt index 3510a7e388d6d..b80cc81fd2c31 100644 --- a/roottest/CMakeLists.txt +++ b/roottest/CMakeLists.txt @@ -1,5 +1,3 @@ -find_package(ROOT REQUIRED CONFIG) - if(MSVC) set(CMAKE_SKIP_TEST_ALL_DEPENDENCY TRUE) set(CMAKE_SUPPRESS_REGENERATION TRUE) @@ -53,12 +51,13 @@ else() # root-config --prefix helps to retrieve ROOTSYS env variable. # ROOT_BINDIR is set by ROOTConfig.cmake - find_program(ROOT_CONFIG_EXECUTABLE root-config PATHS ${ROOT_BINDIR}) - if(NOT ROOT_CONFIG_EXECUTABLE) - message(ERROR "root-config is not found, please rerun configuration step.") + set(ROOT_CONFIG_EXECUTABLE ${ROOT_BINDIR}/root-config) + if(NOT EXISTS ${ROOT_CONFIG_EXECUTABLE}) + message(FATAL_ERROR "root-config was not found in ${ROOT_CONFIG_EXECUTABLE}.") + endif() + if(NOT IS_DIRECTORY ${ROOTSYS}) + message(FATAL_ERROR "ROOTSYS should be set before configuring roottest.") endif() - execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--prefix" OUTPUT_VARIABLE ROOTSYS RESULT_VARIABLE RETVAR OUTPUT_STRIP_TRAILING_WHITESPACE) - set(ROOTSYS ${ROOTSYS} CACHE INTERNAL "") execute_process(COMMAND ${ROOT_CONFIG_EXECUTABLE} "--tutdir" OUTPUT_VARIABLE ROOT_TUTORIALS_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) set(ROOT_LIBRARIES Core RIO Net Hist Gpad Tree Rint Matrix MathCore) set(ROOT_root_CMD ${ROOTSYS}/bin/root.exe) @@ -116,19 +115,20 @@ endif() set(CMAKE_ROOTTEST_DICT ON) # Set the CMake module path. Here are all the custom CMake modules. -set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${ROOT_SOURCE_DIR}/roottest/cmake/modules") +list(APPEND CMAKE_MODULE_PATH "${ROOT_SOURCE_DIR}/roottest/cmake/modules") #---Set flag for PyROOT tests that are expected to fail -if(ROOT_pyroot_FOUND) +if(pyroot) set(PYTESTS_WILLFAIL WILLFAIL) endif() # Find OpenGL find_library(OPENGL_gl_LIBRARY NAMES GL) -# Setup standard includes / links. -include_directories(${ROOT_INCLUDE_DIRS} ${ROOT_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) -link_directories(${ROOT_LIBRARY_DIR}) +# Set global include dirs and library dirs for roottest. +# These are picked up in the old-style dictionary generation and when standard CMake targets are created. +include_directories(${ROOTSYS}/include ${CMAKE_CURRENT_SOURCE_DIR}) +link_directories(${ROOTSYS}/lib) set(CMAKE_MACOSX_RPATH TRUE) # use RPATH for MacOSX include(RoottestCTest) diff --git a/roottest/cling/functionTemplate/CMakeLists.txt b/roottest/cling/functionTemplate/CMakeLists.txt index 1bf6b46aff4c8..c700b3d3c4ea0 100644 --- a/roottest/cling/functionTemplate/CMakeLists.txt +++ b/roottest/cling/functionTemplate/CMakeLists.txt @@ -10,7 +10,7 @@ ROOTTEST_ADD_TEST(runreferenceuse DEPENDS MyClassReferenceUse.C LABELS roottest regression cling) -if(ROOT_pyroot_FOUND) +if(pyroot) ROOTTEST_ADD_TEST(testcint MACRO testcint.py PRECMD ${ROOT_root_CMD} -b -q -l -e .L\ t.h+ @@ -18,12 +18,4 @@ if(ROOT_pyroot_FOUND) OUTCNVCMD grep -v "just a comment" WORKING_DIR ${CMAKE_CURRENT_SOURCE_DIR} LABELS roottest regression cling) - - if(ROOT_cintex_FOUND) - ROOTTEST_ADD_TEST(testreflex - MACRO testreflex.py - OUTREF pythonreflexrun.ref - OUTCNVCMD grep -v "just a comment" - LABELS roottest regression cling) - endif() endif() diff --git a/roottest/cling/functionTemplate/pythonreflexrun.ref b/roottest/cling/functionTemplate/pythonreflexrun.ref deleted file mode 100644 index dbb713e28b8ca..0000000000000 --- a/roottest/cling/functionTemplate/pythonreflexrun.ref +++ /dev/null @@ -1,18 +0,0 @@ -['IsA', 'ShowMembers', 'get', 'get', 'get', 'get', 'getfloat', 'set', 'set', 'set', 'set'] -called get() -called get() -called get() -t now 3 1 2 -t now 42.31 -called set() -called get() -called get() -called get() -t now 3 1 2 -t now 7 -called set() -called get() -called get() -called get() -t now 3 1 2 -t now 9 diff --git a/roottest/cling/functionTemplate/testreflex.py b/roottest/cling/functionTemplate/testreflex.py deleted file mode 100755 index 96d8bab9e19f8..0000000000000 --- a/roottest/cling/functionTemplate/testreflex.py +++ /dev/null @@ -1,24 +0,0 @@ -from ROOT import gSystem, Cintex -from sys import stdout - -def printme(o): - print "t now %g %d %d" % (o.get(Double)(), o.get(int)(), o.get(float)()) - print "t now %g" % (o.getfloat()) - stdout.flush() - -gSystem.Load("libCintex") -Cintex.Enable() -gSystem.Load("t_rflx_wrap_cxx") -sortedMethods = [ item for item in t.__dict__.keys() if item[0:2] != '__' ] -sortedMethods.sort() -print "# just a comment" -print sortedMethods -stdout.flush() -o = t() -printme(o) -o.set(12) -printme(o) -o.set(42.34) -printme(o) - - diff --git a/roottest/cling/parsing/ALICE-18972/CMakeLists.txt b/roottest/cling/parsing/ALICE-18972/CMakeLists.txt index 0ce123fcb748f..e0b3e2720f89b 100644 --- a/roottest/cling/parsing/ALICE-18972/CMakeLists.txt +++ b/roottest/cling/parsing/ALICE-18972/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_geom_FOUND) +if(geom) ROOTTEST_GENERATE_REFLEX_DICTIONARY(ALICE_18972 mylib.h SELECTION mylib_sel.xml) ROOTTEST_ADD_TEST(ALICE_18972 diff --git a/roottest/cling/template/CMakeLists.txt b/roottest/cling/template/CMakeLists.txt index 0eeb493508814..aa5a8ed455977 100644 --- a/roottest/cling/template/CMakeLists.txt +++ b/roottest/cling/template/CMakeLists.txt @@ -16,7 +16,7 @@ ROOTTEST_ADD_TEST(templateSingleton FIXTURES_REQUIRED cling-template-Singleton-fixture LABELS roottest regression cling) -if(NOT ROOT_runtime_cxxmodules_FOUND) +if(NOT runtime_cxxmodules) ROOTTEST_GENERATE_DICTIONARY(slaveDict slave.h LINKDEF slaveLinkDef.h) endif() ROOTTEST_GENERATE_DICTIONARY(masterDict master.h NO_CXXMODULE LINKDEF masterLinkDef.h) diff --git a/roottest/cmake/modules/SearchInstalledSoftwareRoottest.cmake b/roottest/cmake/modules/SearchInstalledSoftwareRoottest.cmake index c01e792654ded..4b1d7da65d293 100644 --- a/roottest/cmake/modules/SearchInstalledSoftwareRoottest.cmake +++ b/roottest/cmake/modules/SearchInstalledSoftwareRoottest.cmake @@ -6,7 +6,7 @@ if(NOT MSVC) endif() #---Check for MPI--------------------------------------------------------------- -if(ROOT_mpi_FOUND) +if(mpi) message(STATUS "Looking for MPI") find_package(MPI) if(NOT MPI_FOUND) diff --git a/roottest/python/CMakeLists.txt b/roottest/python/CMakeLists.txt index f04605b44dc71..f69e1dd37389d 100644 --- a/roottest/python/CMakeLists.txt +++ b/roottest/python/CMakeLists.txt @@ -1,10 +1,10 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) - if(ROOT_roofit_FOUND) + if(roofit) set(roofit True) else() set(roofit False) - endif(ROOT_roofit_FOUND) + endif(roofit) find_python_module(pytest OPTIONAL) diff --git a/roottest/python/JsMVA/CMakeLists.txt b/roottest/python/JsMVA/CMakeLists.txt index a1e3ee167acff..60d80089203d0 100644 --- a/roottest/python/JsMVA/CMakeLists.txt +++ b/roottest/python/JsMVA/CMakeLists.txt @@ -1,4 +1,4 @@ -#if (ROOT_pyroot_FOUND AND NOT ROOT_CLASSIC_BUILD) # Do not run with classic build +#if (pyroot AND NOT ROOT_CLASSIC_BUILD) # Do not run with classic build #set(NBDIFFUTIL ${CMAKE_CURRENT_SOURCE_DIR}/nbdiff.py ) diff --git a/roottest/python/JupyROOT/CMakeLists.txt b/roottest/python/JupyROOT/CMakeLists.txt index a1f71633c93dd..932fe478efe1f 100644 --- a/roottest/python/JupyROOT/CMakeLists.txt +++ b/roottest/python/JupyROOT/CMakeLists.txt @@ -2,7 +2,7 @@ if(NOT MSVC OR win_broken_tests) # Do not run with classic build or if tests are vetoed -if (ROOT_pyroot_FOUND AND NOT ROOT_CLASSIC_BUILD) +if (pyroot AND NOT ROOT_CLASSIC_BUILD) set(MODULES_LOCATION ${ROOTSYS}/lib/JupyROOT/helpers) set(NBDIFFUTIL ${CMAKE_CURRENT_SOURCE_DIR}/nbdiff.py ) @@ -38,7 +38,7 @@ foreach(NOTEBOOK ${NOTEBOOKS}) PYTHON_DEPS jupyter) endforeach() -if(ROOT_imt_FOUND) +if(imt) # No need to compare output here, just check it runs with no error set(IMT_NB Cpp_IMT_Canvas.ipynb) get_filename_component(NOTEBOOKBASE ${IMT_NB} NAME_WE) diff --git a/roottest/python/basic/CMakeLists.txt b/roottest/python/basic/CMakeLists.txt index 89b9560c46f58..31e0ba7b698bd 100644 --- a/roottest/python/basic/CMakeLists.txt +++ b/roottest/python/basic/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) ROOTTEST_ADD_TEST(basic MACRO PyROOT_basictests.py COPY_TO_BUILDDIR ArgumentPassingCompiled.C ReturnValues.C SimpleClass.C ArgumentPassingInterpreted.C diff --git a/roottest/python/cling/CMakeLists.txt b/roottest/python/cling/CMakeLists.txt index b9b34c696d346..a11cc6198322a 100644 --- a/roottest/python/cling/CMakeLists.txt +++ b/roottest/python/cling/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) set(api_macro_file runPyAPITestCppyy.C) # Uses new Cppyy API ROOTTEST_ADD_TEST(api MACRO ${api_macro_file} diff --git a/roottest/python/cpp/CMakeLists.txt b/roottest/python/cpp/CMakeLists.txt index f5088746acadc..1b1dc56327a7c 100644 --- a/roottest/python/cpp/CMakeLists.txt +++ b/roottest/python/cpp/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) if(NOT MSVC OR win_broken_tests) ROOTTEST_ADD_TEST(cpp MACRO PyROOT_cpptests.py diff --git a/roottest/python/distrdf/CMakeLists.txt b/roottest/python/distrdf/CMakeLists.txt index 319bc21d0a1c9..2ac476259144e 100644 --- a/roottest/python/distrdf/CMakeLists.txt +++ b/roottest/python/distrdf/CMakeLists.txt @@ -1,8 +1,7 @@ # Test only if: # * RDataFrame is available # * PyROOT is available -if (ROOT_dataframe_FOUND AND - ROOT_pyroot_FOUND) +if (dataframe AND pyroot) file(COPY test_headers DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY test_shared_libs DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/roottest/python/distrdf/backends/CMakeLists.txt b/roottest/python/distrdf/backends/CMakeLists.txt index f4a242cc095a9..9f2c42727d4b7 100644 --- a/roottest/python/distrdf/backends/CMakeLists.txt +++ b/roottest/python/distrdf/backends/CMakeLists.txt @@ -1,13 +1,13 @@ -if(NOT ROOT_test_distrdf_dask_FOUND AND NOT ROOT_test_distrdf_pyspark_FOUND) +if(NOT test_distrdf_dask AND NOT test_distrdf_pyspark) return() endif() -if(ROOT_test_distrdf_dask_FOUND) +if(test_distrdf_dask) list(APPEND DISTRDF_BACKENDS_IN_USE "dask") list(APPEND DISTRDF_RESOURCE_LOCKS "dask_resource_lock") endif() -if(ROOT_test_distrdf_pyspark_FOUND) +if(test_distrdf_pyspark) # Define environment variables needed in all pyspark tests set(PYSPARK_ENV_VARS PYSPARK_PYTHON=${Python3_EXECUTABLE}) diff --git a/roottest/python/function/CMakeLists.txt b/roottest/python/function/CMakeLists.txt index 8e3cc857deb8e..93aed8d99cd58 100644 --- a/roottest/python/function/CMakeLists.txt +++ b/roottest/python/function/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) ROOTTEST_ADD_TEST(function MACRO PyROOT_functiontests.py COPY_TO_BUILDDIR InstallableFunction.C GlobalFunction.C GlobalFunction2.C GlobalFunction3.C diff --git a/roottest/python/memory/CMakeLists.txt b/roottest/python/memory/CMakeLists.txt index 62203057a7e0b..021f006091112 100644 --- a/roottest/python/memory/CMakeLists.txt +++ b/roottest/python/memory/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) ROOTTEST_ADD_TEST(memory MACRO PyROOT_memorytests.py COPY_TO_BUILDDIR MemTester.C diff --git a/roottest/python/numba/CMakeLists.txt b/roottest/python/numba/CMakeLists.txt index 1299192ddd086..5f639345af4b8 100644 --- a/roottest/python/numba/CMakeLists.txt +++ b/roottest/python/numba/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) if(NOT MSVC OR win_broken_tests) ROOTTEST_ADD_TEST(numba MACRO PyROOT_numbatests.py) diff --git a/roottest/python/pickle/CMakeLists.txt b/roottest/python/pickle/CMakeLists.txt index 85215b7356627..cb9d912b8de4e 100644 --- a/roottest/python/pickle/CMakeLists.txt +++ b/roottest/python/pickle/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) ROOTTEST_ADD_TEST(write MACRO PyROOT_writetests.py COPY_TO_BUILDDIR PickleTypes.C diff --git a/roottest/python/pythonizations/CMakeLists.txt b/roottest/python/pythonizations/CMakeLists.txt index 2d86160af7b45..1096c671606bc 100644 --- a/roottest/python/pythonizations/CMakeLists.txt +++ b/roottest/python/pythonizations/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) if(NOT MSVC OR "${CMAKE_GENERATOR_PLATFORM}" MATCHES "Win32" OR win_broken_tests) ROOTTEST_ADD_TEST(pythonizations MACRO PyROOT_pythonizationtest.py diff --git a/roottest/python/regression/CMakeLists.txt b/roottest/python/regression/CMakeLists.txt index 00134a31bef27..98581fe4b4362 100644 --- a/roottest/python/regression/CMakeLists.txt +++ b/roottest/python/regression/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) set(scott_file ScottCppyy.C) # Uses Cppyy header if(NOT MSVC OR win_broken_tests) diff --git a/roottest/python/stl/CMakeLists.txt b/roottest/python/stl/CMakeLists.txt index 67c73366cc8a6..09465fb4a08a3 100644 --- a/roottest/python/stl/CMakeLists.txt +++ b/roottest/python/stl/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) if(NOT MSVC OR win_broken_tests) ROOTTEST_ADD_TEST(stl MACRO PyROOT_stltests.py diff --git a/roottest/python/ttree/CMakeLists.txt b/roottest/python/ttree/CMakeLists.txt index 31f5e93df6a43..2025e3369b089 100644 --- a/roottest/python/ttree/CMakeLists.txt +++ b/roottest/python/ttree/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_pyroot_FOUND) +if(pyroot) ROOTTEST_ADD_TEST(ttree MACRO PyROOT_ttreetests.py COPY_TO_BUILDDIR TTreeTypes.C diff --git a/roottest/root/multicore/CMakeLists.txt b/roottest/root/multicore/CMakeLists.txt index a77e783c1c682..6440c55e0edbe 100644 --- a/roottest/root/multicore/CMakeLists.txt +++ b/roottest/root/multicore/CMakeLists.txt @@ -24,7 +24,7 @@ endif() ROOTTEST_GENERATE_EXECUTABLE(testSetAddress testSetAddress.cpp - LIBRARIES Core MathCore RIO Tree GenVector Physics + LIBRARIES Core MathCore RIO Tree TreePlayer GenVector Physics FIXTURES_SETUP root-multicore-testSetAddress-fixture) if(MSVC) diff --git a/roottest/root/ntuple/atlas-datavector/CMakeLists.txt b/roottest/root/ntuple/atlas-datavector/CMakeLists.txt index baabe5ce7241d..de5f82cb264d7 100644 --- a/roottest/root/ntuple/atlas-datavector/CMakeLists.txt +++ b/roottest/root/ntuple/atlas-datavector/CMakeLists.txt @@ -78,7 +78,7 @@ ROOTTEST_ADD_TEST(read # instantiation done by the Python bindings was leading to a faulty behaviour: # the user-provided class template "AtlasLikeDataVector" does not # correspond to what the compiler sees, so we need to inject this information. -if(ROOT_pyroot_FOUND) +if(pyroot) ROOT_ADD_PYUNITTEST( rentry_getptr rentry_getptr.py diff --git a/roottest/root/roofitstats/CMakeLists.txt b/roottest/root/roofitstats/CMakeLists.txt index 9c1f8daf19e4a..56038b7e3048c 100644 --- a/roottest/root/roofitstats/CMakeLists.txt +++ b/roottest/root/roofitstats/CMakeLists.txt @@ -1,4 +1,4 @@ -if(ROOT_roofit_FOUND) +if(roofit) ROOTTEST_ADD_TEST(RooDataSet_ASCII_in MACRO ${CMAKE_CURRENT_SOURCE_DIR}/ASCII-in-out.C