From a6f5b8c5e20711b2b1d90a8d9fffc69b442f83a0 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 24 Aug 2026 17:28:33 +0200 Subject: [PATCH 1/5] [x3d] mv to builtin subdir for consistency will help with copyright licensing for Debian better split externals from internals of ROOT could be replaced later on with something more crossplatform better divide C from C++ code could become standalone library and link it from ROOT, so better modularization for Debian helps with Doxygen no need for extra exclude path --- CMakeLists.txt | 3 +++ builtins/x3d/CMakeLists.txt | 6 ++++++ {graf3d/x3d/src => builtins/x3d}/x3d.c | 0 {graf3d/x3d/src => builtins/x3d}/x3d.h | 0 documentation/doxygen/Doxyfile | 1 - graf3d/x3d/CMakeLists.txt | 1 - 6 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 builtins/x3d/CMakeLists.txt rename {graf3d/x3d/src => builtins/x3d}/x3d.c (100%) rename {graf3d/x3d/src => builtins/x3d}/x3d.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43418679c479c..88a743dc7f5a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,6 +404,9 @@ if (opengl) add_subdirectory (builtins/glad) # hard coded builtin for graf3d endif() add_subdirectory (graf3d) +if(NOT WIN32 AND x11) + add_subdirectory (builtins/x3d) # hard coded builtin for graf3d on Unix with x11 +endif() if(NOT minimal) add_subdirectory (gui) else() diff --git a/builtins/x3d/CMakeLists.txt b/builtins/x3d/CMakeLists.txt new file mode 100644 index 0000000000000..8ce3811bb2ecb --- /dev/null +++ b/builtins/x3d/CMakeLists.txt @@ -0,0 +1,6 @@ +# This was forked in 1993 and slightly adapted for ROOT. See +# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/inc/x3d.h +# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/src/x3d.c +# vs http://hpux.connect.org.uk/hppd/hpux/X11/Viewers/x3d-2.2/ download source and rename from .tar.gz to just .tar + +target_sources(X3d PRIVATE x3d.h x3d.c) diff --git a/graf3d/x3d/src/x3d.c b/builtins/x3d/x3d.c similarity index 100% rename from graf3d/x3d/src/x3d.c rename to builtins/x3d/x3d.c diff --git a/graf3d/x3d/src/x3d.h b/builtins/x3d/x3d.h similarity index 100% rename from graf3d/x3d/src/x3d.h rename to builtins/x3d/x3d.h diff --git a/documentation/doxygen/Doxyfile b/documentation/doxygen/Doxyfile index c55705908c484..085ead947bf48 100644 --- a/documentation/doxygen/Doxyfile +++ b/documentation/doxygen/Doxyfile @@ -1087,7 +1087,6 @@ EXCLUDE = ../../interpreter/ \ ../../core/newdelete/ \ ../../core/textinput/ \ ../../builtins/ \ - ../../graf3d/x3d/ \ ../../documentation/doxygen/html # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or diff --git a/graf3d/x3d/CMakeLists.txt b/graf3d/x3d/CMakeLists.txt index 223eab9bdadd1..cd5a05eedd1a7 100644 --- a/graf3d/x3d/CMakeLists.txt +++ b/graf3d/x3d/CMakeLists.txt @@ -13,7 +13,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(X3d TViewerX3D.h TX3DFrame.h SOURCES - src/x3d.c src/TViewerX3D.cxx src/TX3DFrame.cxx LIBRARIES From 407228431e6a5cb9e55ba4505a9c05af7ba6aafb Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 24 Aug 2026 19:10:57 +0200 Subject: [PATCH 2/5] Update CMakeLists.txt --- graf3d/x3d/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graf3d/x3d/CMakeLists.txt b/graf3d/x3d/CMakeLists.txt index cd5a05eedd1a7..5f416905b1852 100644 --- a/graf3d/x3d/CMakeLists.txt +++ b/graf3d/x3d/CMakeLists.txt @@ -22,4 +22,4 @@ ROOT_STANDARD_LIBRARY_PACKAGE(X3d Gui ) -target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR}) +target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} ./) From ca92ac37bbd8633c001bf0a7e8e1badc2cc21273 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Mon, 24 Aug 2026 19:14:08 +0200 Subject: [PATCH 3/5] Update CMakeLists.txt --- graf3d/x3d/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graf3d/x3d/CMakeLists.txt b/graf3d/x3d/CMakeLists.txt index 5f416905b1852..ab82f298318fc 100644 --- a/graf3d/x3d/CMakeLists.txt +++ b/graf3d/x3d/CMakeLists.txt @@ -22,4 +22,4 @@ ROOT_STANDARD_LIBRARY_PACKAGE(X3d Gui ) -target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} ./) +target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} src/) # src for x3d builtin From 90f465e718306a9fc63d77ac1941d76301b7d694 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 25 Aug 2026 08:32:15 +0200 Subject: [PATCH 4/5] [cmake] do not split CMakeLists for X3d as suggested by linev --- CMakeLists.txt | 3 --- builtins/x3d/CMakeLists.txt | 6 ------ graf3d/x3d/CMakeLists.txt | 3 ++- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 builtins/x3d/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 88a743dc7f5a1..43418679c479c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -404,9 +404,6 @@ if (opengl) add_subdirectory (builtins/glad) # hard coded builtin for graf3d endif() add_subdirectory (graf3d) -if(NOT WIN32 AND x11) - add_subdirectory (builtins/x3d) # hard coded builtin for graf3d on Unix with x11 -endif() if(NOT minimal) add_subdirectory (gui) else() diff --git a/builtins/x3d/CMakeLists.txt b/builtins/x3d/CMakeLists.txt deleted file mode 100644 index 8ce3811bb2ecb..0000000000000 --- a/builtins/x3d/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -# This was forked in 1993 and slightly adapted for ROOT. See -# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/inc/x3d.h -# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/src/x3d.c -# vs http://hpux.connect.org.uk/hppd/hpux/X11/Viewers/x3d-2.2/ download source and rename from .tar.gz to just .tar - -target_sources(X3d PRIVATE x3d.h x3d.c) diff --git a/graf3d/x3d/CMakeLists.txt b/graf3d/x3d/CMakeLists.txt index ab82f298318fc..b08dce70afea0 100644 --- a/graf3d/x3d/CMakeLists.txt +++ b/graf3d/x3d/CMakeLists.txt @@ -15,6 +15,7 @@ ROOT_STANDARD_LIBRARY_PACKAGE(X3d SOURCES src/TViewerX3D.cxx src/TX3DFrame.cxx + ../../builtins/x3d/x3d.c LIBRARIES ${X11_LIBRARIES} DEPENDENCIES @@ -22,4 +23,4 @@ ROOT_STANDARD_LIBRARY_PACKAGE(X3d Gui ) -target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} src/) # src for x3d builtin +target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} src/ ../../builtins/x3d/) # src for src/X3DDefs.h From a04cfc09b0ff0623272e70f7f6a6b2e2e3d56622 Mon Sep 17 00:00:00 2001 From: ferdymercury Date: Tue, 25 Aug 2026 08:34:52 +0200 Subject: [PATCH 5/5] [cmake] restore comments --- graf3d/x3d/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/graf3d/x3d/CMakeLists.txt b/graf3d/x3d/CMakeLists.txt index b08dce70afea0..f48ee049ffe96 100644 --- a/graf3d/x3d/CMakeLists.txt +++ b/graf3d/x3d/CMakeLists.txt @@ -23,4 +23,9 @@ ROOT_STANDARD_LIBRARY_PACKAGE(X3d Gui ) -target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} src/ ../../builtins/x3d/) # src for src/X3DDefs.h +# This ROOT package depends on a hard-coded builtin C library (x3d) that was forked in 1993 and slightly adapted for ROOT. See +# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/inc/x3d.h +# https://github.com/root-project/root/blob/852600061bcacd9b255d44f6312c96b6b1e00a2d/x3d/src/x3d.c +# vs http://hpux.connect.org.uk/hppd/hpux/X11/Viewers/x3d-2.2/ download source and rename from .tar.gz to just .tar + +target_include_directories(X3d PRIVATE ${X11_INCLUDE_DIR} src/ ../../builtins/x3d/) # src for src/X3DDefs.h, ../../builtins/x3d/ for x3d.h