diff --git a/.github/workflows/cache_vcpkg.yml b/.github/workflows/cache_vcpkg.yml index 26e81fe4121da..435a562da0a48 100644 --- a/.github/workflows/cache_vcpkg.yml +++ b/.github/workflows/cache_vcpkg.yml @@ -36,7 +36,7 @@ jobs: %VCPKG_ROOT%\bootstrap-vcpkg.bat - name: Upload Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: base path: ${{ env.VCPKG_ROOT }} @@ -50,11 +50,11 @@ jobs: zip-name: ["vcpkg-dartsim-deps-v7.0"] deps: [ - "assimp ccd eigen3 entt fcl fmt spdlog bullet3 coin-or-ipopt freeglut glfw3 nlopt ode opencl opengl osg pagmo2 pybind11 tinyxml2 urdfdom yaml-cpp", + "assimp ccd eigen3 entt fcl fmt spdlog bullet3 coin-or-ipopt freeglut glfw3 nlopt ode opencl opengl osg pagmo2 tinyxml2 urdfdom yaml-cpp", ] include: - zip-name: "vcpkg-dartsim-deps-v6.14" - deps: "assimp ccd eigen3 fcl fmt spdlog bullet3 coin-or-ipopt flann freeglut glfw3 nlopt ode opengl osg pagmo2 pybind11 tinyxml2 urdfdom" + deps: "assimp ccd eigen3 fcl fmt spdlog bullet3 coin-or-ipopt flann freeglut glfw3 nlopt ode opengl osg pagmo2 tinyxml2 urdfdom" # - zip-name: "vcpkg-dartsim-deps-min-v7.0" # deps: "assimp ccd eigen3 entt fcl fmt spdlog" @@ -116,7 +116,7 @@ jobs: ) - name: Upload Vcpkg Artifacts - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: ${{ matrix.zip-name }} path: ./${{ matrix.zip-name }}.zip diff --git a/CMakeLists.txt b/CMakeLists.txt index 24d40a165f211..18dca0d36833b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,11 +1,7 @@ #=============================================================================== # CMake settings #=============================================================================== -if(WIN32) - cmake_minimum_required(VERSION 3.11) -else() - cmake_minimum_required(VERSION 3.10.2) -endif() +cmake_minimum_required(VERSION 3.16.3) project(dart) @@ -106,6 +102,7 @@ option(DART_FAST_DEBUG "Add -O1 option for DEBUG mode build" OFF) # See: https://medium.com/@alasher/colored-c-compiler-output-with-ninja-clang-gcc-10bfe7f2b949 option(DART_FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF) +option(DART_DOWNLOAD_BUILD_DEPS "Download build dependencies" ON) #=============================================================================== # Print intro diff --git a/python/dartpy/CMakeLists.txt b/python/dartpy/CMakeLists.txt index 9a897351a4523..7eceec05d5cdc 100644 --- a/python/dartpy/CMakeLists.txt +++ b/python/dartpy/CMakeLists.txt @@ -6,6 +6,31 @@ # # This file is provided under the "BSD-style" License +if(DART_DOWNLOAD_BUILD_DEPS) + include(FetchContent) + FetchContent_Declare( + pybind11 + GIT_REPOSITORY https://github.com/pybind/pybind11.git + GIT_TAG v2.11.1 + ) + + # Set options + set(PYBIND11_TEST OFF CACHE BOOL "" FORCE) + set(PYBIND11_FINDPYTHON ON CACHE BOOL "" FORCE) + + # To suppress warning, Policy CMP0042 is not set + set(CMAKE_MACOSX_RPATH 1) + + FetchContent_MakeAvailable(pybind11) +else() + # Find pybind11, including PythonInterp and PythonLibs + find_package(pybind11 2.9.1 CONFIG) + if(NOT pybind11_FOUND) + message(WARNING "Disabling [dartpy] due to missing pybind11 >= 2.9.1.") + return() + endif() +endif() + if(NOT DARTPY_PYTHON_VERSION) set(DARTPY_PYTHON_VERSION 3.4 CACHE STRING "Choose the target Python version (e.g., 3.4, 2.7)" FORCE) endif() @@ -16,7 +41,6 @@ set(PYBIND11_PYTHON_VERSION ${DARTPY_PYTHON_VERSION}) if(WIN32) set(PYBIND11_FINDPYTHON TRUE) endif() -find_package(pybind11 2.2.0 QUIET) if(NOT pybind11_FOUND) message(WARNING "Disabling [dartpy] due to missing pybind11 >= 2.2.0.") return()