cmake_minimum_required(VERSION 3.6) project(pybind11-download NONE) include(ExternalProject) ExternalProject_Add( pybind11 PREFIX . GIT_REPOSITORY "https://github.com/pybind/pybind11.git" GIT_TAG v2.10.3 GIT_CONFIG advice.detachedHead=false # otherwise we'll get "You are in 'detached HEAD' state..." SOURCE_DIR "${CMAKE_BINARY_DIR}/third-party/pybind11" GIT_SHALLOW ON # No history needed (requires cmake 3.6) # Override default steps with no action, we just want the clone step. CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" )