Skip to content

Commit 80cd00c

Browse files
committed
[CMake] keep the python module as a folder for now
ref #72 (comment)
1 parent 598516f commit 80cd00c

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

bindings/python/CMakeLists.txt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ IF(APPLE)
4242
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES SUFFIX ".so")
4343
ENDIF(APPLE)
4444

45-
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES PREFIX "" OUTPUT_NAME ${PROJECT_NAME})
45+
SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_NAME})
4646

47-
INSTALL(TARGETS ${PYWRAP} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${PYTHON_SITELIB})
47+
INSTALL(TARGETS ${PYWRAP} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${PYTHON_SITELIB}/${PROJECT_NAME})
48+
49+
SET(PYTHON_FILES
50+
__init__.py
51+
)
52+
53+
FOREACH(python ${PYTHON_FILES})
54+
PYTHON_INSTALL_ON_SITE(${PROJECT_NAME} ${python})
55+
ENDFOREACH(python)

bindings/python/module.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
namespace bp = boost::python;
3636
using namespace tsid::python;
3737

38-
BOOST_PYTHON_MODULE(tsid) {
38+
BOOST_PYTHON_MODULE(libtsid_pywrap)
39+
{
3940
eigenpy::enableEigenPy();
4041
eigenpy::exposeAngleAxis();
4142
eigenpy::exposeQuaternion();

bindings/python/tsid/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .libtsid_pywrap import *

0 commit comments

Comments
 (0)