wjakob / nanobind

nanobind: tiny and efficient C++/Python bindings
BSD 3-Clause "New" or "Revised" License
2.35k stars 198 forks source link

[BUG]: cmake doesn't install anything with -DNB_CREATE_INSTALL_RULES=YES #775

Open yurivict opened 1 week ago

yurivict commented 1 week ago

Problem description

The complete cmake arguments list:

-DNB_INSTALL_DATADIR="" -DCMAKE_C_COMPILER:STRING="cc" -DCMAKE_CXX_COMPILER:STRING="c++" -DCMAKE_C_FLAGS:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing " -DCMAKE_C_FLAGS_DEBUG:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing " -DCMAKE_C_FLAGS_RELEASE:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -DNDEBUG" -DCMAKE_CXX_FLAGS:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -I/usr/ports/devel/nanobind/work/nanobind-2.2.0-8-gfd22b8c/include -I/usr/local/include/python3.11 -isystem /usr/local/include " -DCMAKE_CXX_FLAGS_DEBUG:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -I/usr/ports/devel/nanobind/work/nanobind-2.2.0-8-gfd22b8c/include -I/usr/local/include/python3.11 -isystem /usr/local/include " -DCMAKE_CXX_FLAGS_RELEASE:STRING="-O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -I/usr/ports/devel/nanobind/work/nanobind-2.2.0-8-gfd22b8c/include -I/usr/local/include/python3.11 -isystem /usr/local/include -DNDEBUG" -DCMAKE_EXE_LINKER_FLAGS:STRING=" -fstack-protector-strong " -DCMAKE_MODULE_LINKER_FLAGS:STRING=" -fstack-protector-strong " -DCMAKE_SHARED_LINKER_FLAGS:STRING=" -fstack-protector-strong " -DCMAKE_INSTALL_PREFIX:PATH="/usr/local" -DCMAKE_AUTOGEN_PARALLEL:STRING="7" -DCMAKE_BUILD_TYPE:STRING="Release" -DTHREADS_HAVE_PTHREAD_ARG:BOOL=YES -DCMAKE_INSTALL_RPATH_USE_LINK_PATH=YES -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON -DNB_CREATE_INSTALL_RULES:BOOL=ON -DNB_TEST_FREE_THREADED:BOOL=OFF -DNB_TEST:BOOL=OFF -DCMAKE_SKIP_INSTALL_RULES:BOOL=OFF -GNinja -DPython_ADDITIONAL_VERSIONS=3.11 -DPython_EXECUTABLE:FILEPATH="/usr/local/bin/python3.11" -DPython3_EXECUTABLE:FILEPATH="/usr/local/bin/python3.11" -DBOOST_PYTHON_SUFFIX:STRING=311

The "install" target is missing for both ninja and GNU make cmake backends.

Reproducible example code

No response

wjakob commented 1 week ago

That's a lot of custom arguments to CMake! Does it work out of the box if you don't specify anything? I just tested it here locally on macOS, and the install target works just fine.