Skip to content

Pybind11 on Windows might need a CMake version newer than 3.10.1? #2357

@patrikhuber

Description

@patrikhuber

After updating to the latest master commit of pybind11, my AppVeyor build on Windows is hitting an error:

-- pybind11 v2.6.0 dev
-- Found PythonInterp: C:\Python36-x64\python.exe (found version "3.6.8") 
-- Found PythonLibs: C:/Python36-x64/libs/python36.lib
-- Configuring done
CMake Error at 3rdparty/pybind11/tools/pybind11Tools.cmake:152 (target_link_libraries):
  Error evaluating generator expression:
    $<COMPILE_LANGUAGE:CXX>
  $<COMPILE_LANGUAGE:...> may not be used with Visual Studio generators.
Call Stack (most recent call first):
  python/CMakeLists.txt:1 (pybind11_add_module)

(and a few repetitions of that error). Full build log is here, if you can access it: https://ci.appveyor.com/project/patrikhuber/eos/builds/34429669

This is with cmake-3.10.1 from https://cmake.org/files/v3.10/cmake-3.10.1-win64-x64.zip. According to the pybind11 CMake requirements, the minimum is 3.7 so this should work?

Environment: AppVeyor os: Visual Studio 2017, and CMake Generator "Visual Studio 15 Win64".

If I change my AppVeyor build script to cmake-3.18.1 (https://github.com/Kitware/CMake/releases/download/v3.18.1/cmake-3.18.1-win64-x64.zip), then it works, no error.

I could try a few cmake versions in-between, if that helps. The repo/branch for this is https://github.com/patrikhuber/eos/blob/fix-appveyor-pybind11-cmake/appveyor.yml.

I have no issues upgrading my CMake version, no need to fix this for ancient CMake versions. People should be on latest CMake versions anyway :-) But I thought it would be good to report this, so that if appropriate, you might want to update the minimum required version for pybind11. Or perhaps I'm making some mistake!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions