[package] pybind11/2.9.1: pybind11_add_module not found
See original GitHub issuePackage and Environment Details (include every applicable attribute)
- Package Name/Version: pybind11/2.9.1
- Operating System+version: Windows 10
- Compiler+version: VS 16 2019
- Conan version: conan 1.44.1
- Python version: Python 3.7.7
Conan profile (output of conan profile show default
or conan profile show <profile>
if custom profile is in use)
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
build_type=Debug
[options]
[conf]
[build_requires]
[env]
Steps to reproduce (Include if Applicable)
conanfile.txt
[requires]
pybind11/2.9.1
[generators]
CMakeDeps
CMakeToolchain
CMakeLists.txt
find_package(pybind11 REQUIRED)
include_directories("/path/to/python/include")
pybind11_add_module(example pybind.cpp lib.cpp)
Logs (Include/Attach if Applicable)
Click to expand log
-- Conan: Component target declared 'pybind11::main'
-- Conan: Component target declared 'pybind11::headers'
-- Conan: Component target declared 'pybind11::embed'
-- Conan: Component target declared 'pybind11::module'
-- Conan: Component target declared 'pybind11::python_link_helper'
-- Conan: Component target declared 'pybind11::windows_extras'
-- Conan: Component target declared 'pybind11::lto'
-- Conan: Component target declared 'pybind11::thin_lto'
-- Conan: Component target declared 'pybind11::opt_size'
-- Conan: Component target declared 'pybind11::python2_no_register'
-- Conan: Target declared 'pybind11::pybind11'
CMake Error at src/pybind/CMakeLists.txt:4 (pybind11_add_module):
Unknown CMake command "pybind11_add_module".
-- Configuring incomplete, errors occurred!
Workarounds
This can be fixed by manually include the pybind11Tools.cmake
file which defines the function pybind11_add_module.
It seems that conan generated config.cmake file does not include pybind11’s tools definition file. Is this the designed behaviour or my settings might be wrong?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:6
Top Results From Across the Web
Cmake: using conan pybind11 package
I have used pybind in the past (two or three years ago) and it worked without problems with conan. However, I tried to...
Read more >CMake helpers - pybind11 documentation
CMake variable, disables find_package(pybind11) when not REQUIRED , perhaps to force internal build. Commands#. pybind11_add_module#. This module defines the ...
Read more >Installing the library - pybind11 documentation
Include as a submodule. This assumes you are placing your dependencies in extern/ , and that you are using GitHub; if you are...
Read more >Build systems - pybind11 documentation
pybind11_add_module and pybind11_extension will be unavailable, and the targets will be missing any Python specific behavior. New in version 2.6. Embedding the ...
Read more >Wenzel Jakob
And the source code is always available at github.com/pybind/pybind11. Core features ... from C++ to Python when the hash function is not defined...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For me, there were two suitable include directories in pybind11_INCLUDE_DIRS (basically, a subdirectory and its parent). I wasn’t sure whether there are any circumstances under which one of them might be missing, so I decided to basically try both of them (it shouldn’t really hurt). This is why there are two alternatives, even though one of them should be enough.
have this problem too