-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
66 lines (61 loc) · 2.02 KB
/
setup.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
# GNU General Public License v3.0
#
# This file is part of the GAHM model (https:#github.com/adcirc/gahm).
# Copyright (c) 2023 ADCIRC Development Group.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
#
# Author: Zach Cobell
# Contact: zcobell@thewaterinstitute.org
#
# This file adapted from the cmake-build-extension examples
#
import inspect
import sys
import os
from pathlib import Path
import cmake_build_extension
import setuptools
init_py = inspect.cleandoc(
"""
from . import pygahm
__version__ = "0.0.1"
"""
)
CIBW_CMAKE_OPTIONS = []
if "CIBUILDWHEEL" in os.environ and os.environ["CIBUILDWHEEL"] == "1":
# The manylinux variant runs in Debian Stretch and it uses lib64 folder
if sys.platform == "linux":
CIBW_CMAKE_OPTIONS += ["-DCMAKE_INSTALL_LIBDIR=lib"]
setuptools.setup(
ext_modules=[
cmake_build_extension.CMakeExtension(
name="pygahm",
install_prefix="pygahm",
write_top_level_init=init_py,
source_dir=str(Path(__file__).parent.absolute()),
cmake_configure_options=[
"-DPython3_ROOT_DIR={:s}".format(str(Path(sys.prefix).resolve())),
"-DGAHM_ENABLE_PYTHON:BOOL=ON",
"-DPYTHON_PACKAGE_BUILD:BOOL=ON",
"-DGAHM_ENABLE_SHARED:BOOL=OFF",
"-DGAHM_ENABLE_STATIC:BOOL=OFF",
]
+ CIBW_CMAKE_OPTIONS,
),
],
cmdclass=dict(
build_ext=cmake_build_extension.BuildExtension,
),
)