From 43cfb24699d1e9c9d604afd9c9d14d92e20e64ce Mon Sep 17 00:00:00 2001 From: lyonR Date: Mon, 26 May 2025 07:42:40 +0200 Subject: [PATCH 1/4] create basic build process --- .gitignore | 8 +++-- .gitmodules | 6 ++++ CMakeLists.txt | 2 ++ Makefile | 80 ++++++++++++++++++++++++++++++++++++++++++++++ build_venv_pip.txt | 5 +++ vendors/OpenSubdiv | 1 + vendors/OpenUSD | 1 + 7 files changed, 100 insertions(+), 3 deletions(-) create mode 100644 Makefile create mode 100644 build_venv_pip.txt create mode 160000 vendors/OpenSubdiv create mode 160000 vendors/OpenUSD diff --git a/.gitignore b/.gitignore index 212afa3..6297f0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ -build -install +build/ +install/ +build_venv/ +imgui.ini .vscode -.DS_Store \ No newline at end of file +.DS_Store diff --git a/.gitmodules b/.gitmodules index 5376241..ae4ffb7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,3 +17,9 @@ [submodule "vendors/glew"] path = vendors/glew url = https://github.com/Perlmint/glew-cmake.git +[submodule "vendors/OpenUSD"] + path = vendors/OpenUSD + url = https://github.com/PixarAnimationStudios/OpenUSD.git +[submodule "vendors/OpenSubdiv"] + path = vendors/OpenSubdiv + url = https://github.com/PixarAnimationStudios/OpenSubdiv.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c1a36d..1091d64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(pxr REQUIRED) find_package(OpenGL REQUIRED) +find_package(X11 REQUIRED) + add_subdirectory(vendors) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..db70c06 --- /dev/null +++ b/Makefile @@ -0,0 +1,80 @@ +rhel_install_dep: + sudo dnf install -y libXt-devel + +create_venv: + python3 -m venv build_venv + . ./build_venv/bin/activate ;\ + pip install -r ./build_venv_pip.txt + +build_open_subdiv: + cd ./vendors/OpenSubdiv/ && \ + cmake -DCMAKE_INSTALL_PREFIX=./install \ + -DCMAKE_PREFIX_PATH=./install \ + -DCMAKE_BUILD_TYPE=Debug \ + -DNO_EXAMPLES=ON \ + -DNO_TUTORIALS=ON \ + -DNO_REGRESSION=ON \ + -DNO_DOC=ON \ + -DNO_OMP=ON \ + -DNO_CUDA=ON \ + -DNO_OPENCL=ON \ + -DNO_DX=ON \ + -DNO_TESTS=ON \ + -DNO_GLEW=ON \ + -DNO_GLFW=ON \ + -DNO_PTEX=ON \ + -DNO_TBB=ON && \ + cmake --build . --config Debug --target install -j 10 + +build_usd: create_venv + . ./build_venv/bin/activate ; \ + cd ./vendors/OpenUSD/ && \ + python \ + ./build_scripts/build_usd.py \ + --build=./build \ + --build-variant=release \ + --prefer-safety-over-speed \ + -v \ + --no-tests \ + --no-examples \ + --no-tutorials \ + --no-docs \ + --no-python-docs \ + --no-debug-python \ + --no-ptex \ + --no-draco \ + --no-mayapy-tests \ + --no-animx-tests \ + --python \ + --tools \ + --usd-imaging \ + --openvdb \ + --usdview \ + --usdview \ + --no-prman \ + --openimageio \ + --opencolorio \ + --alembic \ + --hdf5 \ + --materialx \ + --embree \ + ./install + +build_app: + mkdir -p build && \ + cd build && \ + cmake -Dpxr_DIR=./vendors/OpenUSD/install/ -DOpenSubdiv_DIR=./vendors/OpenSubdiv/install/lib64/cmake/OpenSubdiv -DCMAKE_INSTALL_PREFIX=../install .. && \ + make && \ + make install + +build: + $(MAKE) create_venv + $(MAKE) build_usd + +clean: + rm -rf ./build_venv && \ + rm -rf ./build && \ + rm -rf ./install + +run: + LD_LIBRARY_PATH=./vendors/OpenUSD/install/lib:./vendors/OpenUSD/install/lib64:$LD_LIBRARY_PATH ./install/bin/ImGuiHydraEditor diff --git a/build_venv_pip.txt b/build_venv_pip.txt new file mode 100644 index 0000000..e4d3e08 --- /dev/null +++ b/build_venv_pip.txt @@ -0,0 +1,5 @@ +PyOpenGL==3.1.9 +PySide6==6.9.0 +PySide6_Addons==6.9.0 +PySide6_Essentials==6.9.0 +shiboken6==6.9.0 diff --git a/vendors/OpenSubdiv b/vendors/OpenSubdiv new file mode 160000 index 0000000..7d0ab55 --- /dev/null +++ b/vendors/OpenSubdiv @@ -0,0 +1 @@ +Subproject commit 7d0ab5530feef693ac0a920585b5c663b80773b3 diff --git a/vendors/OpenUSD b/vendors/OpenUSD new file mode 160000 index 0000000..53d7d64 --- /dev/null +++ b/vendors/OpenUSD @@ -0,0 +1 @@ +Subproject commit 53d7d647d293fe1aaeb03d2186e8cdeefe09a6fd From 2415af49b5435c5397fbd33f7c91992d25b14b14 Mon Sep 17 00:00:00 2001 From: lyonR Date: Mon, 26 May 2025 17:50:58 +0200 Subject: [PATCH 2/4] update the make file to allow build to check if depdencys are build allready --- Makefile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index db70c06..3706906 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +.PHONY: build + + rhel_install_dep: sudo dnf install -y libXt-devel @@ -69,12 +72,23 @@ build_app: build: $(MAKE) create_venv - $(MAKE) build_usd + @if [ ! -d "./vendors/OpenUSD/install/" ]; then \ + $(MAKE) build_usd; \ + fi + @if [ ! -d "./vendors/OpenSubdiv/install/" ]; then \ + $(MAKE) build_open_subdiv; \ + fi + + $(MAKE) build_app + +clean_dep: + rm -rf ./vendors/OpenUSD/install/ && \ + rm -rf ./vendors/OpenSubdiv/install/ clean: rm -rf ./build_venv && \ rm -rf ./build && \ rm -rf ./install -run: +run: build LD_LIBRARY_PATH=./vendors/OpenUSD/install/lib:./vendors/OpenUSD/install/lib64:$LD_LIBRARY_PATH ./install/bin/ImGuiHydraEditor From 318697d5f72c6512bb786b2f0ab3f1693223182f Mon Sep 17 00:00:00 2001 From: lyonR Date: Mon, 26 May 2025 18:22:39 +0200 Subject: [PATCH 3/4] Mirror test --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3706906..59a4889 100644 --- a/Makefile +++ b/Makefile @@ -91,4 +91,4 @@ clean: rm -rf ./install run: build - LD_LIBRARY_PATH=./vendors/OpenUSD/install/lib:./vendors/OpenUSD/install/lib64:$LD_LIBRARY_PATH ./install/bin/ImGuiHydraEditor + LD_LIBRARY_PATH=./vendors/OpenUSD/install/lib:./vendors/OpenUSD/install/lib64:$LD_LIBRARY_PATH ./install/bin/ImGuiHydraEditor test From d6bc7ed98f0de1ac5757b66e4617b4e7f3d225f7 Mon Sep 17 00:00:00 2001 From: lyonR Date: Mon, 26 May 2025 18:23:21 +0200 Subject: [PATCH 4/4] Mirror test --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 59a4889..3706906 100644 --- a/Makefile +++ b/Makefile @@ -91,4 +91,4 @@ clean: rm -rf ./install run: build - LD_LIBRARY_PATH=./vendors/OpenUSD/install/lib:./vendors/OpenUSD/install/lib64:$LD_LIBRARY_PATH ./install/bin/ImGuiHydraEditor test + LD_LIBRARY_PATH=./vendors/OpenUSD/install/lib:./vendors/OpenUSD/install/lib64:$LD_LIBRARY_PATH ./install/bin/ImGuiHydraEditor