Skip to content
Snippets Groups Projects

[Setup] Add support for development install

Merged Christophe Guillon requested to merge cguillon/aidge_core:dev/cguillon/setup-editable into dev
1 file
+ 3
1
Compare changes
  • Side-by-side
  • Inline
+ 3
1
@@ -20,6 +20,7 @@ will not be automatically installed:
Some envvars are available to configure the cmake build:
- AIDGE_BUILD_MODE=Debug|Release to configure the build type, defaults to Debug.
- AIDGE_BUILD_GEN=<build_backend>, passed as -G<build_backend>, defaults to cmake default.
- AIDGE_TEST=OFF|ON to build tests, defaults to OFF.
For instance to use ninja backend on linux, use AIDGE_BUILD_GEN=Ninja.
In this case install ninja first with: pip install ninja.
@@ -113,10 +114,11 @@ class CMakeBuild(build_ext):
cmake_type_opts = ['-G', build_gen] if build_gen else []
cmake_job_opts = ['-j', max_jobs] if build_gen != "Ninja" else []
compile_type = os.environ.get("AIDGE_BUILD_MODE", "Debug")
compile_test = os.environ.get("AIDGE_TEST", "OFF")
install_path = os.path.join(sys.prefix, "lib", "libAidge") if "AIDGE_INSTALL" not in os.environ else os.environ["AIDGE_INSTALL"]
os.chdir(str(build_temp))
self.spawn(['cmake', *cmake_type_opts, str(cwd), param_py, '-DTEST=OFF', f'-DCMAKE_INSTALL_PREFIX:PATH={install_path}', f'-DCMAKE_BUILD_TYPE={compile_type}'])
self.spawn(['cmake', *cmake_type_opts, str(cwd), param_py, f'-DTEST={compile_test}', f'-DCMAKE_INSTALL_PREFIX:PATH={install_path}', f'-DCMAKE_BUILD_TYPE={compile_type}'])
if not self.dry_run:
self.spawn(['cmake', '--build', '.', '--config', compile_type, *cmake_job_opts])
self.spawn(['cmake', '--install', '.', '--config', compile_type])
Loading