Browse Source

python: make the main bindings _magnum, not magnum._magnum.

pull/2/head
Vladimír Vondruš 7 years ago
parent
commit
d0d028f72d
  1. 2
      src/python/magnum/CMakeLists.txt
  2. 4
      src/python/magnum/__init__.py
  3. 2
      src/python/setup.py.cmake

2
src/python/magnum/CMakeLists.txt

@ -40,7 +40,7 @@ target_link_libraries(magnum PRIVATE Magnum::Magnum)
set_target_properties(magnum PROPERTIES
FOLDER "python"
OUTPUT_NAME "_magnum"
LIBRARY_OUTPUT_DIRECTORY ${output_dir}/magnum)
LIBRARY_OUTPUT_DIRECTORY ${output_dir})
if(Magnum_GL_FOUND)
set(magnum_gl_SRCS

4
src/python/magnum/__init__.py

@ -25,13 +25,13 @@
"""Root Magnum module"""
from ._magnum import *
from _magnum import *
# This feels extremely hackish, but without that it wouldn't be possible to
# do `import magnum.math`, which is weird (`from magnum import math` works,
# tho, for whatever reason)
import sys
sys.modules['magnum.math'] = _magnum.math
sys.modules['magnum.math'] = math
__all__ = [
'Deg', 'Rad',

2
src/python/setup.py.cmake

@ -32,7 +32,7 @@ from setuptools.command.build_ext import build_ext
extension_paths = {
# Filled in by cmake
'corrade.containers': '$<TARGET_FILE:corrade_containers>',
'magnum._magnum': '$<TARGET_FILE:magnum>',
'_magnum': '$<TARGET_FILE:magnum>',
'magnum.gl': '${magnum_gl_file}',
'magnum.meshtools': '${magnum_meshtools_file}',
'magnum.primitives': '${magnum_primitives_file}',

Loading…
Cancel
Save