From 3a2cadbfe298042387dcde1bff7b9c46dc9c439f Mon Sep 17 00:00:00 2001 From: Anton Dukhovnikov Date: Sat, 5 Oct 2024 22:17:24 +1300 Subject: [PATCH] fix CI Signed-off-by: Anton Dukhovnikov --- .github/workflows/build.yml | 48 +++++++++++++++++-------------------- usd/CMakeLists.txt | 3 ++- usd/cmake/Packages.cmake | 33 +++++++++++++------------ 3 files changed, 40 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eefa3d7..7323350 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,16 +28,15 @@ jobs: strategy: matrix: usdVersion: - - 21.05 + - 24.05 include: - - usdVersion: 21.05 - usdVersionUrl: 21-05 - pythonVersion: 3.6 - USE_PYTHON_3: ON + - usdVersion: 24.05 + usdVersionUrl: '24.05/usd.py310.linux-x86_64.usdview.release@0.24.05-tc.859+release.2864f3d0' + pythonVersion: '3.10' buildType: Release buildTests: 'ON' - runs-on: ubuntu-18.04 - name: 'Ubuntu 18.04 NVIDIA Pre-built Binaries + runs-on: ubuntu-22.04 + name: 'Ubuntu 22.04 NVIDIA Pre-built Binaries ' steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.pythonVersion }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.pythonVersion }} - name: Download and extract pre-built USD binaries run: | - Invoke-WebRequest https://developer.nvidia.com/usd-${{ matrix.usdVersionUrl }}-binary-windows-python-${{ matrix.pythonVersion }} -OutFile $env:TEMP/usd-${{ matrix.usdVersion }}.zip + Invoke-WebRequest https://developer.nvidia.com/downloads/usd/usd_binaries/${{ matrix.usdVersionUrl }}.zip -OutFile $env:TEMP/usd-${{ matrix.usdVersion }}.zip mkdir -Force $env:TEMP/usd-${{ matrix.usdVersion }} 7z x $env:TEMP/usd-${{ matrix.usdVersion }}.zip $("-o" + "$env:TEMP" + "\usd-${{ matrix.usdVersion }}") -y - name: Create build directories @@ -117,12 +114,11 @@ jobs: run: | cmake -DUSD_ROOT="$env:TEMP/usd-${{ matrix.usdVersion }}" ` -DTBB_ROOT="$env:TEMP/usd-${{ matrix.usdVersion }}" ` - -DBOOST_ROOT="$env:TEMP/usd-${{ matrix.usdVersion }}" ` - -DUSE_PYTHON_3=${{ matrix.USE_PYTHON_3 }} ` + -DBoost_ROOT="$env:TEMP/usd-${{ matrix.usdVersion }}" ` -DCMAKE_BUILD_TYPE=${{ matrix.buildType }} ` -DBUILD_TESTING=${{ matrix.buildTests }} ` -DCMAKE_INSTALL_PREFIX="../_install" ` - -G "Visual Studio 15 2017 Win64" ` + -G "Visual Studio 16 2019" ` ../usd working-directory: "_build" - name: Build @@ -148,12 +144,12 @@ jobs: # Run automated code formatting checks. code-formatting-check: - runs-on: ubuntu-18.04 + runs-on: ubuntu-24.04 steps: - name: Install dependencies (Linux) run: | - sudo apt-get install clang-format-10 - - uses: actions/checkout@v2 + sudo apt-get install clang-format-16 + - uses: actions/checkout@v4 - name: Run clang-format on source code run: | find . \ diff --git a/usd/CMakeLists.txt b/usd/CMakeLists.txt index 5327086..92a0e63 100644 --- a/usd/CMakeLists.txt +++ b/usd/CMakeLists.txt @@ -77,4 +77,5 @@ endif() # Export targets and install package files. # This must come after source tree recursion as exporting targets # requires the targets to be defined in the first place! -include(Export) + +# include(Export) # TODO diff --git a/usd/cmake/Packages.cmake b/usd/cmake/Packages.cmake index 08bb9f1..e2023bd 100644 --- a/usd/cmake/Packages.cmake +++ b/usd/cmake/Packages.cmake @@ -4,30 +4,23 @@ # Boost & python. if (ENABLE_PYTHON_SUPPORT) - # Find python libraries. - if (USE_PYTHON_3) - find_package(PythonInterp 3.0 REQUIRED) - find_package(PythonLibs 3.0 REQUIRED) - else() - find_package(PythonInterp 2.7 REQUIRED) - find_package(PythonLibs 2.7 REQUIRED) - endif() + find_package (Python3 COMPONENTS Interpreter Development Development.Module) # Pick up boost version variables. - find_package(Boost REQUIRED) + find_package(Boost CONFIG REQUIRED) # We can use Boost_VERSION_STRING in CMake 3.14+. set(boost_version_string "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") # Boost provided cmake files in 1.70 and above causes inconsistent failures. - if (${boost_version_string} VERSION_GREATER_EQUAL "1.70") - option(Boost_NO_BOOST_CMAKE "Disable boost-provided cmake config" ON) - if (Boost_NO_BOOST_CMAKE) - message(STATUS "Disabling boost-provided cmake config") - endif() - endif() +# if (${boost_version_string} VERSION_GREATER_EQUAL "1.70") +# option(Boost_NO_BOOST_CMAKE "Disable boost-provided cmake config" ON) +# if (Boost_NO_BOOST_CMAKE) +# message(STATUS "Disabling boost-provided cmake config") +# endif() +# endif() - if (${boost_version_string} VERSION_GREATER_EQUAL "1.67") + if (FALSE) # ${boost_version_string} VERSION_GREATER_EQUAL "1.67") # In boost-1.67 and greater, the boost python component includes the # python major and minor version as part of its name. set(PYTHON_VERSION_DOTLESS "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}") @@ -38,7 +31,7 @@ if (ENABLE_PYTHON_SUPPORT) ) set(Boost_PYTHON_LIBRARY "${Boost_PYTHON${PYTHON_VERSION_DOTLESS}_LIBRARY}") else() - find_package(Boost + find_package(Boost CONFIG COMPONENTS python REQUIRED @@ -47,5 +40,11 @@ if (ENABLE_PYTHON_SUPPORT) endif() # USD & TBB +set(Python3_LIBRARY ${Python3_LIBRARIES}) +set(Python3_INCLUDE_DIR ${Python3_INCLUDE_DIRS}) + +list (APPEND CMAKE_PREFIX_PATH ${USD_ROOT}/lib/cmake) +list (APPEND CMAKE_PREFIX_PATH ${USD_ROOT}/lib64/cmake) + include(${USD_ROOT}/pxrConfig.cmake) find_package(TBB REQUIRED)