Skip to content

Commit a092ad5

Browse files
committed
Use ROOT_MAIN_{SOURCE,BINARY}_DIR instead of CMAKE_{SOURCE, BINARY}_DIR. NFC
This patch renames `CMAKE_SOURCE_DIR` to `ROOT_MAIN_SOURCE_DIR` and `CMAKE_BINARY_DIR` to `ROOT_MAIN_BINARY_DIR`. The change unblocks progress on PR #16751 and #16211 by allowing them to disentangle the build step of building a user-specified set of components after another which was already built at an earlier stage. Supersedes: #17746.
1 parent 32e74eb commit a092ad5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+445
-441
lines changed

Diff for: CMakeLists.txt

+56-52
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ if(WIN32)
1313
set(CMAKE_SKIP_TEST_ALL_DEPENDENCY TRUE)
1414
endif()
1515

16-
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT ALLOW_IN_SOURCE)
16+
#---We must not use CMAKE_SOURCE_DIR and CMAKE_BINARY_DIR as that breaks the packages ---------
17+
set(ROOT_MAIN_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
18+
set(ROOT_MAIN_BINARY_DIR "${CMAKE_BINARY_DIR}")
19+
20+
if(ROOT_MAIN_SOURCE_DIR STREQUAL ROOT_MAIN_BINARY_DIR AND NOT ALLOW_IN_SOURCE)
1721
message(FATAL_ERROR
1822
" ROOT must be built out-of-source.\n"
1923
" Please see README/INSTALL for more information.")
@@ -45,10 +49,10 @@ project(ROOT)
4549
set(ENV{LANG} C)
4650

4751
#---Set paths where to put the libraries, executables and headers------------------------------
48-
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/lib) # prevent mkdir races
49-
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
50-
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
51-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
52+
file(MAKE_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib) # prevent mkdir races
53+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib)
54+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib)
55+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ROOT_MAIN_BINARY_DIR}/bin)
5256

5357
# Set permissions for installed folders and subfolders that come from the source tree in case
5458
# the permissions in the source tree are wrong since the install command will preserve them
@@ -74,19 +78,19 @@ if(NOT $ENV{ROOTSYS} STREQUAL "")
7478
# if we leave the ':' it will result in an empty entry in the CMAKE_PREFIX_PATH
7579
# which will interpreted as the current directory.
7680
strip_path("CMAKE_PREFIX_PATH" "$ENV{ROOTSYS}")
77-
set(ENV{ROOTSYS} ${CMAKE_BINARY_DIR})
81+
set(ENV{ROOTSYS} ${ROOT_MAIN_BINARY_DIR})
7882
endif()
7983

80-
set(ROOTSYS ${CMAKE_BINARY_DIR})
81-
set(HEADER_OUTPUT_PATH ${CMAKE_BINARY_DIR}/include)
84+
set(ROOTSYS ${ROOT_MAIN_BINARY_DIR})
85+
set(HEADER_OUTPUT_PATH ${ROOT_MAIN_BINARY_DIR}/include)
8286

8387
#---Set the ROOT version--------------------------------------------------------------------
8488
include(cmake/modules/SetROOTVersion.cmake)
8589

8690
message(STATUS "Building ROOT version ${ROOT_FULL_VERSION}")
8791

8892
#---Where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked-------------
89-
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
93+
set(CMAKE_MODULE_PATH ${ROOT_MAIN_SOURCE_DIR}/cmake/modules)
9094

9195
#---Enable Folders in IDE like Visual Studio----------------------------------------------------
9296
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
@@ -259,7 +263,7 @@ if(asan)
259263
endif()
260264

261265
if(NOT MSVC)
262-
set(ASAN_EXTRA_LD_PRELOAD "${CMAKE_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}ROOTSanitizerConfig${CMAKE_SHARED_LIBRARY_SUFFIX}:${ASAN_RUNTIME_LIBRARY}")
266+
set(ASAN_EXTRA_LD_PRELOAD "${ROOT_MAIN_BINARY_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}ROOTSanitizerConfig${CMAKE_SHARED_LIBRARY_SUFFIX}:${ASAN_RUNTIME_LIBRARY}")
263267
endif()
264268

265269
foreach(item IN LISTS ASAN_EXTRA_CXX_FLAGS)
@@ -313,8 +317,8 @@ endforeach()
313317
#---Move (copy) directories to binary tree------------------------------------------------------
314318
set(stamp_file ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/move_artifacts.stamp)
315319
add_custom_command(OUTPUT ${stamp_file}
316-
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/LICENSE ${CMAKE_BINARY_DIR}/LICENSE
317-
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/README ${CMAKE_BINARY_DIR}/README
320+
COMMAND ${CMAKE_COMMAND} -E copy ${ROOT_MAIN_SOURCE_DIR}/LICENSE ${ROOT_MAIN_BINARY_DIR}/LICENSE
321+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${ROOT_MAIN_SOURCE_DIR}/README ${ROOT_MAIN_BINARY_DIR}/README
318322
COMMAND ${CMAKE_COMMAND} -E touch ${stamp_file}
319323
COMMENT "Copying directories such as etc, icons, fonts, js, ui5, etc. to build area")
320324

@@ -335,11 +339,11 @@ foreach(dir_to_copy ${directories_to_copy})
335339
list(FILTER artifacts_in EXCLUDE REGEX "\.(d|swp|so|dylib|lib|dll|pcm|bak)$")
336340

337341
set(artifacts_out ${artifacts_in})
338-
list(TRANSFORM artifacts_out REPLACE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
342+
list(TRANSFORM artifacts_out REPLACE ${ROOT_MAIN_SOURCE_DIR} ${ROOT_MAIN_BINARY_DIR})
339343
list(APPEND all_artifacts ${artifacts_out})
340344

341345
add_custom_command(OUTPUT ${artifacts_out}
342-
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/${dir_to_copy} ${CMAKE_BINARY_DIR}/${dir_to_copy}
346+
COMMAND ${CMAKE_COMMAND} -E copy_directory ${ROOT_MAIN_SOURCE_DIR}/${dir_to_copy} ${ROOT_MAIN_BINARY_DIR}/${dir_to_copy}
343347
COMMENT "Copy ${dir_to_copy}"
344348
DEPENDS ${artifacts_in})
345349
endforeach()
@@ -353,11 +357,11 @@ add_subdirectory (interpreter)
353357
# Update etc/gitinfo.txt for every build.
354358
add_custom_target(gitinfotxt
355359
ALL
356-
COMMAND ${CMAKE_COMMAND} -DSRCDIR=${CMAKE_SOURCE_DIR} -DBINDIR=${CMAKE_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/cmake/modules/UpdateGitInfo.cmake
360+
COMMAND ${CMAKE_COMMAND} -DSRCDIR=${ROOT_MAIN_SOURCE_DIR} -DBINDIR=${ROOT_MAIN_BINARY_DIR} -P ${ROOT_MAIN_SOURCE_DIR}/cmake/modules/UpdateGitInfo.cmake
357361
COMMENT "Updating etc/gitinfo.txt."
358-
BYPRODUCTS ${CMAKE_BINARY_DIR}/etc/gitinfo.txt
362+
BYPRODUCTS ${ROOT_MAIN_BINARY_DIR}/etc/gitinfo.txt
359363
)
360-
install(FILES ${CMAKE_BINARY_DIR}/etc/gitinfo.txt DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
364+
install(FILES ${ROOT_MAIN_BINARY_DIR}/etc/gitinfo.txt DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
361365

362366
#---Recurse into the given subdirectories. This does not actually cause another cmake executable
363367
# to run. The same process will walk through the project's entire directory structure.
@@ -408,17 +412,17 @@ if(MSVC)
408412
else()
409413
set(_os_cat "cat")
410414
endif()
411-
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/include/module.modulemap.extra" _from_native)
412-
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/include/ROOT.modulemap" _to_native)
415+
file(TO_NATIVE_PATH "${ROOT_MAIN_BINARY_DIR}/include/module.modulemap.extra" _from_native)
416+
file(TO_NATIVE_PATH "${ROOT_MAIN_BINARY_DIR}/include/ROOT.modulemap" _to_native)
413417

414-
add_custom_target(copymodulemap DEPENDS "${CMAKE_BINARY_DIR}/include/ROOT.modulemap")
418+
add_custom_target(copymodulemap DEPENDS "${ROOT_MAIN_BINARY_DIR}/include/ROOT.modulemap")
415419
add_custom_command(
416-
OUTPUT "${CMAKE_BINARY_DIR}/include/ROOT.modulemap"
417-
DEPENDS cmake/unix/module.modulemap "${CMAKE_BINARY_DIR}/include/module.modulemap.extra"
418-
COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/cmake/unix/module.modulemap" "${CMAKE_BINARY_DIR}/include/ROOT.modulemap"
420+
OUTPUT "${ROOT_MAIN_BINARY_DIR}/include/ROOT.modulemap"
421+
DEPENDS cmake/unix/module.modulemap "${ROOT_MAIN_BINARY_DIR}/include/module.modulemap.extra"
422+
COMMAND ${CMAKE_COMMAND} -E copy "${ROOT_MAIN_SOURCE_DIR}/cmake/unix/module.modulemap" "${ROOT_MAIN_BINARY_DIR}/include/ROOT.modulemap"
419423
COMMAND ${_os_cat} "${_from_native}" >> "${_to_native}"
420424
)
421-
install(FILES "${CMAKE_BINARY_DIR}/include/ROOT.modulemap" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
425+
install(FILES "${ROOT_MAIN_BINARY_DIR}/include/ROOT.modulemap" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} COMPONENT headers)
422426

423427
add_dependencies(move_headers copymodulemap)
424428

@@ -429,9 +433,9 @@ get_property(__modulemap_extra_content GLOBAL PROPERTY ROOT_CXXMODULES_EXTRA_MOD
429433
string(REPLACE ";" "" __modulemap_extra_content "${__modulemap_extra_content}")
430434
# Write module.modulemap.extra to a temporary file first, to not touch module.modulemap.extra
431435
# if it's unchanged.
432-
file(WRITE "${CMAKE_BINARY_DIR}/include/module.modulemap.extra.tmp" "${__modulemap_extra_content}")
433-
configure_file("${CMAKE_BINARY_DIR}/include/module.modulemap.extra.tmp"
434-
"${CMAKE_BINARY_DIR}/include/module.modulemap.extra"
436+
file(WRITE "${ROOT_MAIN_BINARY_DIR}/include/module.modulemap.extra.tmp" "${__modulemap_extra_content}")
437+
configure_file("${ROOT_MAIN_BINARY_DIR}/include/module.modulemap.extra.tmp"
438+
"${ROOT_MAIN_BINARY_DIR}/include/module.modulemap.extra"
435439
COPYONLY)
436440

437441
# From now on we handled all exposed module and want to make all new modulemaps private to ROOT.
@@ -462,9 +466,9 @@ else()
462466

463467
if(WIN32)
464468
list(APPEND incdirs
465-
${CMAKE_SOURCE_DIR}/graf2d/win32gdk/gdk/src
466-
${CMAKE_SOURCE_DIR}/graf2d/win32gdk/gdk/src/gdk
467-
${CMAKE_SOURCE_DIR}/graf2d/win32gdk/gdk/src/glib
469+
${ROOT_MAIN_SOURCE_DIR}/graf2d/win32gdk/gdk/src
470+
${ROOT_MAIN_SOURCE_DIR}/graf2d/win32gdk/gdk/src/gdk
471+
${ROOT_MAIN_SOURCE_DIR}/graf2d/win32gdk/gdk/src/glib
468472
)
469473
endif()
470474

@@ -484,26 +488,26 @@ else()
484488
etc/dictpch/allHeaders.h
485489
etc/dictpch/allLinkDefs.h
486490
COMMAND
487-
${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/cmake/unix/makepchinput.py
488-
${CMAKE_SOURCE_DIR} . ${pyroot_legacy} ${__cling_pch}
491+
${Python3_EXECUTABLE} ${ROOT_MAIN_SOURCE_DIR}/cmake/unix/makepchinput.py
492+
${ROOT_MAIN_SOURCE_DIR} . ${pyroot_legacy} ${__cling_pch}
489493
COMMAND
490494
${CMAKE_COMMAND} -E env ROOTIGNOREPREFIX=1 ${Python3_EXECUTABLE}
491-
${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch
492-
${__allIncludes} -I${CMAKE_BINARY_DIR}/include -I${CMAKE_SOURCE_DIR}/core
495+
${ROOT_MAIN_SOURCE_DIR}/etc/dictpch/makepch.py etc/allDict.cxx.pch
496+
${__allIncludes} -I${ROOT_MAIN_BINARY_DIR}/include -I${ROOT_MAIN_SOURCE_DIR}/core
493497
DEPENDS
494498
rootcling ${__pch_dependencies} ${__pch_dictionaries}
495-
${CMAKE_SOURCE_DIR}/cmake/unix/makepchinput.py
496-
${CMAKE_SOURCE_DIR}/etc/dictpch/makepch.py
499+
${ROOT_MAIN_SOURCE_DIR}/cmake/unix/makepchinput.py
500+
${ROOT_MAIN_SOURCE_DIR}/etc/dictpch/makepch.py
497501
)
498502
add_custom_target(onepcm ALL DEPENDS etc/allDict.cxx.pch)
499-
install(FILES ${CMAKE_BINARY_DIR}/etc/allDict.cxx.pch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
500-
install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
503+
install(FILES ${ROOT_MAIN_BINARY_DIR}/etc/allDict.cxx.pch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
504+
install(DIRECTORY ${ROOT_MAIN_BINARY_DIR}/etc/dictpch DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
501505
endif()
502506

503507
# FIXME: move installation of PCMS in ROOT_GENERATE_DICTIONARY().
504508
# We are excluding directories, which are accidentaly copied via unxpected behaviour of install(DIRECTORY ..)
505509
install(
506-
DIRECTORY ${CMAKE_BINARY_DIR}/lib/
510+
DIRECTORY ${ROOT_MAIN_BINARY_DIR}/lib/
507511
DESTINATION ${CMAKE_INSTALL_LIBDIR}
508512
FILES_MATCHING
509513
PATTERN "*.pcm"
@@ -547,42 +551,42 @@ add_custom_target(hsimple ALL DEPENDS tutorials/hsimple.root)
547551
add_dependencies(hsimple onepcm)
548552
if(WIN32)
549553
set(hsimple_cmd COMMAND ${CMAKE_COMMAND} -E env PATH="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}\\\;%PATH%"
550-
ROOTIGNOREPREFIX=1 ROOT_HIST=0 $<TARGET_FILE:root.exe> -l -q -b -n -x ${CMAKE_SOURCE_DIR}/tutorials/hsimple.C -e return)
554+
ROOTIGNOREPREFIX=1 ROOT_HIST=0 $<TARGET_FILE:root.exe> -l -q -b -n -x ${ROOT_MAIN_SOURCE_DIR}/tutorials/hsimple.C -e return)
551555
else()
552556
set(hsimple_cmd COMMAND ${MODULES_ROOT_INCPATH} ${ld_library_path}=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}:$ENV{${ld_library_path}}
553-
ROOTIGNOREPREFIX=1 ROOT_HIST=0 $<TARGET_FILE:root.exe> -l -q -b -n -x ${CMAKE_SOURCE_DIR}/tutorials/hsimple.C -e return)
557+
ROOTIGNOREPREFIX=1 ROOT_HIST=0 $<TARGET_FILE:root.exe> -l -q -b -n -x ${ROOT_MAIN_SOURCE_DIR}/tutorials/hsimple.C -e return)
554558
endif()
555559
add_custom_command(OUTPUT tutorials/hsimple.root
556560
${hsimple_cmd}
557561
WORKING_DIRECTORY tutorials
558562
DEPENDS $<TARGET_FILE:root.exe> Cling Hist Tree Gpad Graf HistPainter move_artifacts)
559-
install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)
563+
install(FILES ${ROOT_MAIN_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)
560564

561565
if(runtime_cxxmodules)
562566
add_dependencies(hsimple modules_idx)
563567
endif()
564568

565569
#---copy special headers required for building on Windows----------------------------------------
566570
if(WIN32)
567-
file(COPY cmake/win/w32pragma.h DESTINATION ${CMAKE_BINARY_DIR}/include/)
568-
file(COPY cmake/win/sehmap.h DESTINATION ${CMAKE_BINARY_DIR}/include/)
571+
file(COPY cmake/win/w32pragma.h DESTINATION ${ROOT_MAIN_BINARY_DIR}/include/)
572+
file(COPY cmake/win/sehmap.h DESTINATION ${ROOT_MAIN_BINARY_DIR}/include/)
569573
endif()
570574

571575
#---version--------------------------------------------------------------------------------------
572576
if(NOT WIN32)
573-
add_custom_target(version COMMAND ${Python3_EXECUTABLE} ${CMAKE_SOURCE_DIR}/cmake/unix/makeversion.py
574-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
577+
add_custom_target(version COMMAND ${Python3_EXECUTABLE} ${ROOT_MAIN_SOURCE_DIR}/cmake/unix/makeversion.py
578+
WORKING_DIRECTORY ${ROOT_MAIN_SOURCE_DIR})
575579
endif()
576580

577581
#---distribution commands------------------------------------------------------------------------
578-
add_custom_target(distsrc COMMAND ${CMAKE_SOURCE_DIR}/cmake/unix/makedistsrc.sh "${ROOT_FULL_VERSION}" "${CMAKE_SOURCE_DIR}")
582+
add_custom_target(distsrc COMMAND ${ROOT_MAIN_SOURCE_DIR}/cmake/unix/makedistsrc.sh "${ROOT_FULL_VERSION}" "${ROOT_MAIN_SOURCE_DIR}")
579583
add_custom_target(dist COMMAND cpack --config CPackConfig.cmake)
580584

581585
#---Configure and install various files neded later and for clients -----------------------------
582586
include(RootConfiguration)
583587

584588
#---Installation of project-wise artifacts-------------------------------------------------------
585-
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_INSTALL_PREFIX)
589+
if(NOT ROOT_MAIN_SOURCE_DIR STREQUAL CMAKE_INSTALL_PREFIX)
586590
install(FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
587591
if(gnuinstall)
588592
install(DIRECTORY README/ DESTINATION ${CMAKE_INSTALL_DOCDIR})
@@ -626,16 +630,16 @@ endif()
626630
set(root_jupyter_dir notebook)
627631
set(root_jupyter_config jupyter_notebook_config.py)
628632
configure_file(etc/${root_jupyter_dir}/${root_jupyter_config}.in etc/${root_jupyter_dir}/${root_jupyter_config})
629-
install(FILES ${CMAKE_BINARY_DIR}/etc/${root_jupyter_dir}/${root_jupyter_config} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${root_jupyter_dir})
633+
install(FILES ${ROOT_MAIN_BINARY_DIR}/etc/${root_jupyter_dir}/${root_jupyter_config} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${root_jupyter_dir})
630634

631635
set(root_kernel_dir ${root_jupyter_dir}/kernels/root)
632636
set(root_kernel_file kernel.json)
633637
configure_file(etc/${root_kernel_dir}/${root_kernel_file}.in etc/${root_kernel_dir}/${root_kernel_file})
634-
install(FILES ${CMAKE_BINARY_DIR}/etc/${root_kernel_dir}/${root_kernel_file} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${root_kernel_dir})
638+
install(FILES ${ROOT_MAIN_BINARY_DIR}/etc/${root_kernel_dir}/${root_kernel_file} DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/${root_kernel_dir})
635639

636640
#---install clad header files-------------------------------------------------------------------
637641
if(clad)
638-
install(DIRECTORY ${CMAKE_BINARY_DIR}/etc/cling/plugins/
642+
install(DIRECTORY ${ROOT_MAIN_BINARY_DIR}/etc/cling/plugins/
639643
DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/cling/plugins)
640644
endif()
641645

@@ -645,7 +649,7 @@ if(pyroot)
645649
endif()
646650

647651
#---Configure Testing using CTest----------------------------------------------------------------
648-
configure_file(${CMAKE_SOURCE_DIR}/cmake/modules/CTestCustom.cmake ${CMAKE_BINARY_DIR} COPYONLY)
652+
configure_file(${ROOT_MAIN_SOURCE_DIR}/cmake/modules/CTestCustom.cmake ${ROOT_MAIN_BINARY_DIR} COPYONLY)
649653
if(testing)
650654
include(RootCTest)
651655
set(upstreamprefix https://github.com/root-project)

Diff for: bindings/pyroot/cppyy/CPyCppyy/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ target_include_directories(${libname}
9393

9494
target_include_directories(${libname}
9595
PRIVATE
96-
${CMAKE_BINARY_DIR}/ginclude
96+
${ROOT_MAIN_BINARY_DIR}/ginclude
9797
PUBLIC
9898
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
9999
)
@@ -112,7 +112,7 @@ if (NOT MSVC AND NOT CMAKE_INSTALL_LIBDIR STREQUAL CMAKE_INSTALL_PYTHONDIR)
112112
\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_PYTHONDIR}/${LIB_FILE_NAME} SYMBOLIC)")
113113
endif()
114114

115-
file(COPY ${headers} DESTINATION ${CMAKE_BINARY_DIR}/include/CPyCppyy)
115+
file(COPY ${headers} DESTINATION ${ROOT_MAIN_BINARY_DIR}/include/CPyCppyy)
116116
install(FILES ${headers}
117117
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/CPyCppyy
118118
COMPONENT headers)

Diff for: bindings/pyroot/cppyy/cppyy-backend/cling/python/cppyy_backend/cmake/FindCppyy.cmake

+6-6
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ function(cppyy_add_bindings pkg pkg_version author author_email)
304304

305305
# License file
306306
if("${ARG_LICENSE_FILE}" STREQUAL "")
307-
set(ARG_LICENSE_FILE ${CMAKE_SOURCE_DIR}/LICENSE)
307+
set(ARG_LICENSE_FILE ${ROOT_MAIN_SOURCE_DIR}/LICENSE)
308308
endif()
309309
set(LICENSE_FILE ${ARG_LICENSE_FILE})
310310

311311
# ReadMe file
312312
if("${ARG_README_FILE}" STREQUAL "")
313-
set(ARG_README_FILE ${CMAKE_SOURCE_DIR}/README.rst)
313+
set(ARG_README_FILE ${ROOT_MAIN_SOURCE_DIR}/README.rst)
314314
endif()
315315
set(README_FILE ${ARG_README_FILE})
316316

@@ -542,7 +542,7 @@ function(cppyy_add_bindings pkg pkg_version author author_email)
542542
#
543543
# Copy pure python code
544544
#
545-
file(COPY ${CMAKE_SOURCE_DIR}/py/ DESTINATION ${pkg_dir}
545+
file(COPY ${ROOT_MAIN_SOURCE_DIR}/py/ DESTINATION ${pkg_dir}
546546
USE_SOURCE_PERMISSIONS
547547
FILES_MATCHING PATTERN "*.py")
548548

@@ -561,13 +561,13 @@ function(cppyy_add_bindings pkg pkg_version author author_email)
561561
file(GLOB_RECURSE PY_PKG_FILES
562562
LIST_DIRECTORIES FALSE
563563
CONFIGURE_DEPENDS
564-
"${CMAKE_SOURCE_DIR}/py/*.py")
564+
"${ROOT_MAIN_SOURCE_DIR}/py/*.py")
565565
string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_STR)
566-
set(pkg_whl "${CMAKE_BINARY_DIR}/dist/${pkg}-${pkg_version}-py3-none-${SYSTEM_STR}_${CMAKE_SYSTEM_PROCESSOR}.whl")
566+
set(pkg_whl "${ROOT_MAIN_BINARY_DIR}/dist/${pkg}-${pkg_version}-py3-none-${SYSTEM_STR}_${CMAKE_SYSTEM_PROCESSOR}.whl")
567567
add_custom_command(OUTPUT ${pkg_whl}
568568
COMMAND ${LibClang_Python3_EXECUTABLE} setup.py bdist_wheel
569569
DEPENDS ${SETUP_PY_FILE} ${lib_name} ${setup_cfg}
570-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
570+
WORKING_DIRECTORY ${ROOT_MAIN_BINARY_DIR}
571571
)
572572
add_custom_target(wheel ALL
573573
DEPENDS ${pkg_whl}

Diff for: bindings/pyroot/pythonizations/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ endforeach()
167167
add_custom_target(ROOTPythonizationsPySources ALL DEPENDS ${py_sources_in_localruntimedir})
168168

169169
# Copy headers inside build_dir/include/ROOT
170-
file(COPY ${ROOT_headers_dir}/ DESTINATION ${CMAKE_BINARY_DIR}/include/ROOT)
170+
file(COPY ${ROOT_headers_dir}/ DESTINATION ${ROOT_MAIN_BINARY_DIR}/include/ROOT)
171171

172172
set(libname ROOTPythonizations)
173173

Diff for: builtins/cfitsio/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
set(CFITSIO_VERSION 4.4.0)
88

9-
set(CFITSIO_PREFIX ${CMAKE_BINARY_DIR}/CFITSIO-prefix)
9+
set(CFITSIO_PREFIX ${ROOT_MAIN_BINARY_DIR}/CFITSIO-prefix)
1010
set(CFITSIO_LIBRARIES ${CFITSIO_PREFIX}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}cfitsio${CMAKE_STATIC_LIBRARY_SUFFIX})
1111

1212
if(NOT WIN32)

Diff for: builtins/nlohmann/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ set(nlohmann_json_VERSION "${JSON_VERSION_MAJOR}.${JSON_VERSION_MINOR}.${JSON_VE
1212
unset(JSON_H)
1313

1414
add_custom_command(
15-
OUTPUT ${CMAKE_BINARY_DIR}/include/nlohmann/json.hpp
16-
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/builtins/nlohmann/json.hpp ${CMAKE_BINARY_DIR}/include/nlohmann/json.hpp
17-
DEPENDS ${CMAKE_SOURCE_DIR}/builtins/nlohmann/json.hpp)
18-
add_custom_target(builtin_nlohmann_json_incl DEPENDS ${CMAKE_BINARY_DIR}/include/nlohmann/json.hpp)
15+
OUTPUT ${ROOT_MAIN_BINARY_DIR}/include/nlohmann/json.hpp
16+
COMMAND ${CMAKE_COMMAND} -E copy ${ROOT_MAIN_SOURCE_DIR}/builtins/nlohmann/json.hpp ${ROOT_MAIN_BINARY_DIR}/include/nlohmann/json.hpp
17+
DEPENDS ${ROOT_MAIN_SOURCE_DIR}/builtins/nlohmann/json.hpp)
18+
add_custom_target(builtin_nlohmann_json_incl DEPENDS ${ROOT_MAIN_BINARY_DIR}/include/nlohmann/json.hpp)
1919
set_property(GLOBAL APPEND PROPERTY ROOT_BUILTIN_TARGETS builtin_nlohmann_json_incl)
2020

21-
install(FILES ${CMAKE_SOURCE_DIR}/builtins/nlohmann/json.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nlohmann/)
21+
install(FILES ${ROOT_MAIN_SOURCE_DIR}/builtins/nlohmann/json.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/nlohmann/)
2222

2323

Diff for: builtins/xrootd/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include(ExternalProject)
88

99
set(XROOTD_VERSION "5.7.2")
1010

11-
set(XROOTD_PREFIX ${CMAKE_BINARY_DIR})
11+
set(XROOTD_PREFIX ${ROOT_MAIN_BINARY_DIR})
1212
message(STATUS "Downloading and building XROOTD version ${XROOTD_VERSION}")
1313

1414
list(REMOVE_ITEM XROOTD_CLIENT_LIBRARIES OpenSSL::SSL)

0 commit comments

Comments
 (0)