-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release package 3.0.12 cannot be compiled with -DWITH_PYTHON=1
#32
Comments
-DWITH_PYTHON=1
Hi Cyril! The problems of 1) and 2) are related to the conversion "Git repo" > "Zip source code" which does not contain the git module dependencies and the git tags, as you mention. I could however remove the "source code" files of this Github page and invite the user to About 3), the reason is that we are using Doxygen to "transfer" the documentation of C++ functions to the help of Python functions. This was an attempt to have up-to-date documentation in the binding. The steps are:
This is documented in the following page: If you have better ideas for all these points, do not hesitate! Thanks, |
I do not know how to fix 1) and 2). For 2), it seems that including submodules in package generated by Github is a long-awaited request. For 1), you could write a fallback in
For this problem, I was able to rewrite the Cmake script to do this automatically. I was going to propose a PR but I do not have the right to push commits and branchs on this repo. So here is the diff of my commit: diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index a64dac51..805d8ef9 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -28,25 +28,15 @@
# Generating docstring documentation from Doxygen
################################################################################
- if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml)
- if(NOT WIN32)
- string(ASCII 27 Esc)
- set(ColourReset "${Esc}[m")
- set(Red "${Esc}[31m")
- set(Blue "${Esc}[34m")
- endif()
-
- message(STATUS "${Red}/!\\ Run \"make api\" for generating Doxygen doc, then \"cmake ..\" again, before \"make\"${ColourReset}")
- endif()
-
- message(STATUS "Generating docstrings from doxygen files...")
- file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docstring)
- execute_process(COMMAND ${PYTHON_EXECUTABLE}
- ${PROJECT_SOURCE_DIR}/scripts/pybind/doxygen2docstring.py
- ${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml/
- ${CMAKE_CURRENT_BINARY_DIR}/docstring)
# The file generated_docstring.cpp contains all docstring of the library
-
+ add_custom_target(docs-headers
+ COMMAND ${CMAKE_COMMAND} -E make_directory
+ ${CMAKE_CURRENT_BINARY_DIR}/docstring
+ COMMAND ${PYTHON_EXECUTABLE}
+ ${PROJECT_SOURCE_DIR}/scripts/pybind/doxygen2docstring.py
+ ${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml/
+ ${CMAKE_CURRENT_BINARY_DIR}/docstring
+ DEPENDS api)
################################################################################
# Library for Python binding
@@ -90,6 +80,8 @@
src/robotics/tubex_py_DataLoader.cpp
)
+ add_dependencies (tube docs-headers)
+
target_include_directories(tube
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../include
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}
After that I can compile with |
I downloaded the .tar.gz package from https://github.com/SimonRohou/tubex-lib/releases/tag/v3.0.12
I wanted to compiled it with the python bindings. My cmake commands was:
There was several problems:
Cmake was unable to find the correct Tubex version (because the tubex directory is not a git repo, the cmake command version_from_git failed, but it did not prevent cmake to continue). See the start of the cmake output below. [ This error also appears without
-DWITH_PYTHON=1
]The cmake command failed with the error
I was able to fix this by downloading the pybind11 source code into the directory (the problem is that the submodule is not added into the .tar.gz archive).
This error does not appears if I remove
-DWITH_PYTHON=1
.This error does not appears if I remove
-DWITH_PYTHON=1
.Cmake output:
The text was updated successfully, but these errors were encountered: