Unverified Commit cfd05ba6 authored by Justin Carpentier's avatar Justin Carpentier Committed by GitHub
Browse files

Fix doc generation for Python bindings on Windows (#204)



* doc/python: fix encoding

* github: add doc dependencies

* doc: fix open

* doc/python: use correct seperator

* cmake: add missing file

* doc/python: more fix

* [Doc][Python] Fix file inclusion in generated doc.

* cmake: fix linkage issue on Windows

* doc: yet another fix for Windows
Co-authored-by: Joseph Mirabel's avatarJoseph Mirabel <jmirabel@laas.fr>
parent 2e7555a9
Pipeline #12176 passed with stage
in 23 minutes and 33 seconds
......@@ -10,3 +10,6 @@ dependencies:
- boost
- eigenpy
- python
- doxygen
- lxml
- pylatexenc
......@@ -78,7 +78,11 @@ endif()
# Required dependencies
SET_BOOST_DEFAULT_OPTIONS()
EXPORT_BOOST_DEFAULT_OPTIONS()
ADD_PROJECT_DEPENDENCY(Boost REQUIRED)
IF(WIN32)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS chrono thread date_time)
ELSE(WIN32)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED)
ENDIF(WIN32)
if (BUILD_PYTHON_INTERFACE)
FINDPYTHON()
search_for_boost_python(REQUIRED)
......@@ -155,6 +159,7 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/collision_object.h
include/hpp/fcl/collision_utility.h
include/hpp/fcl/octree.h
include/hpp/fcl/profile.h
include/hpp/fcl/fwd.hh
include/hpp/fcl/mesh_loader/assimp.h
include/hpp/fcl/mesh_loader/loader.h
......
......@@ -95,7 +95,7 @@ template_open_namespace = \
template_close_namespace = \
"""}} // namespace {namespace}"""
template_include_intern = \
"""#include "{filename}"
"""#include <doxygen_autodoc/{filename}>
"""
template_include_extern = \
"""#include <{filename}>
......@@ -130,7 +130,7 @@ def _templateParamToDict (param):
def makeHeaderGuard (filename):
import os
return filename.upper().replace('.', '_').replace(os.path.sep, '_')
return filename.upper().replace('.', '_').replace('/', '_')
def format_description (brief, detailed):
b = [ el.text.strip() for el in brief .iter() if el.text ] if brief is not None else []
......@@ -260,7 +260,7 @@ class MemberDef(Reference):
import os.path
loc = self.xml.find('location')
# The location is based on $CMAKE_SOURCE_DIR. Remove first directory.
return loc.attrib['file'].split(os.path.sep,1)[1]
return loc.attrib['file'].split('/',1)[1]
class CompoundBase(Reference):
def __init__ (self, compound, index):
......@@ -584,7 +584,7 @@ class Index:
prototypes.append (prototype)
self.output.out (
"".join([ template_include_intern.format (filename=filename)
"".join([ template_include_extern.format (filename=filename)
for filename in includes]))
self.output.out (template_open_namespace.format (namespace="doxygen"))
......@@ -649,7 +649,8 @@ class OutputStreams(object):
if name in self._created_files:
self._out = self._created_files[name]
else:
self._out = open(fullname, mode='w')
import codecs
self._out = codecs.open(fullname, mode='w', encoding="utf-8")
self._created_files[name] = self._out
# Header
......@@ -673,7 +674,10 @@ class OutputStreams(object):
self._out = None
def out(self, *args):
print (*args, file=self._out)
if sys.version_info >= (3,):
print (*args, file=self._out)
else:
print(' '.join(str(arg) for arg in args).encode('utf-8'), file=self._out)
def warn(self, *args):
print (self.errorPrefix, *args, file=self._warn)
def err(self, *args):
......
......@@ -168,6 +168,15 @@ TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
# assimp::assimp # Not working
)
IF(WIN32)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME}
INTERFACE
Boost::chrono
Boost::thread
Boost::date_time
)
ENDIF(WIN32)
if(HPP_FCL_HAS_QHULL)
target_compile_definitions(${LIBRARY_NAME} PRIVATE -DHPP_FCL_HAS_QHULL)
target_include_directories(${LIBRARY_NAME} SYSTEM PRIVATE
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment