generated from python-project-templates/python-template-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
25 lines (19 loc) · 648 Bytes
/
setup.py
File metadata and controls
25 lines (19 loc) · 648 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import os
import multiprocessing
import sys
from skbuild import setup
python_version = f"{sys.version_info.major}.{sys.version_info.minor}"
cmake_args = [f"-DPYTHON_VERSION={python_version}"]
if "CMAKE_ARGS" in os.environ:
cmake_args.extend(os.environ["CMAKE_ARGS"].split(" "))
if "STATIC_PYTHON" in os.environ:
cmake_args.append("-DSTATIC_PYTHON=On")
if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ:
os.environ["CMAKE_BUILD_PARALLEL_LEVEL"] = str(multiprocessing.cpu_count())
setup(
name="cpp_template",
version="0.1.0",
packages=["cpp_template"],
cmake_install_dir="cpp_template",
cmake_args=cmake_args,
)