Commit 82fec745 authored by Johann Cohen-Tanugi's avatar Johann Cohen-Tanugi
Browse files

add a custom doc building and the install step for th C++ executables

parent 4e879301
......@@ -70,6 +70,7 @@ import subprocess
from distutils.version import LooseVersion
from setuptools import setup, Extension, find_packages
from setuptools.command.build_ext import build_ext
from setuptools import Command
import pathlib
here = pathlib.Path(__file__).parent.resolve()
......@@ -104,7 +105,8 @@ class CMakeBuild(build_ext):
def build_extension(self, ext):
extdir = os.path.abspath(
os.path.dirname(self.get_ext_fullpath(ext.name)))
cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
cmake_args = ['-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}',
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir,
'-DPYTHON_EXECUTABLE=' + sys.executable]
cfg = 'Debug' if self.debug else 'Release'
......@@ -131,8 +133,19 @@ class CMakeBuild(build_ext):
cwd=self.build_temp, env=env)
subprocess.check_call(['cmake', '--build', '.'] + build_args,
cwd=self.build_temp)
subprocess.check_call(['cmake', '--install', '.'],
cwd=self.build_temp)
print() # Add an empty line for cleaner output
class MakeDoc(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
cmd="doxygen Doxyfile"
subprocess.check_call(['doxygen', 'Doxyfile'], cwd='doc')
setup(
name='lephare',
......@@ -148,9 +161,9 @@ setup(
ext_modules=[CMakeExtension('lephare._lephare')],
include_package_data=True,
# add custom build_ext command
cmdclass=dict(build_ext=CMakeBuild),
cmdclass=dict(build_ext=CMakeBuild, doc=MakeDoc),
zip_safe=False,
python_requires=">=3.8",
extras_require={"test": "pytest"}
extras_require={"test": "pytest"},
)
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