Skip to content

Commit bee8351

Browse files
committed
Migrate build system from autotools to CMake
- Update necpp_src submodule to master (feat/cmake-migration) - Replace make -f Makefile.git && ./configure with cmake -B build && cmake --build build - Add necpp_src/build/ to include_dirs for cmake-generated config.h - Replace autoconf/automake/libtool deps with cmake in CI workflows
1 parent cb4db7d commit bee8351

6 files changed

Lines changed: 23 additions & 23 deletions

File tree

.github/workflows/build-necpp-wheels.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ jobs:
3030
if: runner.os == 'Linux'
3131
run: |
3232
sudo apt-get update
33-
sudo apt-get install -y swig autoconf automake libtool
33+
sudo apt-get install -y swig cmake
3434
3535
- name: Install build dependencies (macOS)
3636
if: runner.os == 'macOS'
3737
run: |
38-
brew install swig autoconf automake libtool
38+
brew install swig cmake
3939
4040
- name: Configure necpp_src
4141
shell: bash
4242
run: |
4343
cd necpp_src
44-
make -f Makefile.git
45-
./configure
44+
cmake -B build -DCMAKE_BUILD_TYPE=Release
45+
cmake --build build
4646
4747
- name: Setup package directory and generate SWIG wrapper
4848
shell: bash
@@ -103,13 +103,13 @@ jobs:
103103
- name: Install build dependencies
104104
run: |
105105
sudo apt-get update
106-
sudo apt-get install -y swig autoconf automake libtool
106+
sudo apt-get install -y swig cmake
107107
108108
- name: Configure necpp_src
109109
run: |
110110
cd necpp_src
111-
make -f Makefile.git
112-
./configure
111+
cmake -B build -DCMAKE_BUILD_TYPE=Release
112+
cmake --build build
113113
114114
- name: Setup package directory and generate SWIG wrapper
115115
run: |

.github/workflows/build-pynec-wheels.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ jobs:
3030
if: runner.os == 'Linux'
3131
run: |
3232
sudo apt-get update
33-
sudo apt-get install -y swig autoconf automake libtool
33+
sudo apt-get install -y swig cmake
3434
3535
- name: Install build dependencies (macOS)
3636
if: runner.os == 'macOS'
3737
run: |
38-
brew install swig autoconf automake libtool
38+
brew install swig cmake
3939
4040
- name: Configure necpp_src
4141
shell: bash
4242
run: |
4343
cd necpp_src
44-
make -f Makefile.git
45-
./configure
44+
cmake -B build -DCMAKE_BUILD_TYPE=Release
45+
cmake --build build
4646
4747
- name: Setup package directory and generate SWIG wrapper
4848
shell: bash
@@ -105,13 +105,13 @@ jobs:
105105
- name: Install build dependencies
106106
run: |
107107
sudo apt-get update
108-
sudo apt-get install -y swig autoconf automake libtool
108+
sudo apt-get install -y swig cmake
109109
110110
- name: Configure necpp_src
111111
run: |
112112
cd necpp_src
113-
make -f Makefile.git
114-
./configure
113+
cmake -B build -DCMAKE_BUILD_TYPE=Release
114+
cmake --build build
115115
116116
- name: Setup package directory and generate SWIG wrapper
117117
run: |

PyNEC/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ rm -f necpp_src
1111
ln -s ../necpp_src .
1212
DIR=`pwd`
1313
cd ../necpp_src
14-
make -f Makefile.git
15-
./configure
14+
cmake -B build -DCMAKE_BUILD_TYPE=Release
15+
cmake --build build
1616
cd ${DIR}
1717

1818
# Generate SWIG wrapper

PyNEC/setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@
3636
)
3737
nec_sources.extend(glob("PyNEC_wrap.cxx"))
3838

39-
# config.h is generated from ./configure in the parent directory.
39+
# config.h is generated from cmake in the parent directory.
4040
#
4141
if np is not None:
42-
include_dirs = [np.get_include(), "necpp_src/src", "necpp_src/", "necpp_src/win32/", "necpp_src/src/eigen3"]
42+
include_dirs = [np.get_include(), "necpp_src/src", "necpp_src/", "necpp_src/build/", "necpp_src/win32/", "necpp_src/src/eigen3"]
4343
else:
4444
# Fallback for metadata-only setup phases (e.g., egg_info) before build deps are installed
45-
include_dirs = ["necpp_src/src", "necpp_src/", "necpp_src/win32/", "necpp_src/src/eigen3"]
45+
include_dirs = ["necpp_src/src", "necpp_src/", "necpp_src/build/", "necpp_src/win32/", "necpp_src/src/eigen3"]
4646

4747
necpp_module = Extension(
4848
"_PyNEC",

necpp/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ rm -f necpp_src
77
ln -s ../necpp_src .
88
DIR=`pwd`
99
cd necpp_src
10-
make -f Makefile.git
11-
./configure
10+
cmake -B build -DCMAKE_BUILD_TYPE=Release
11+
cmake --build build
1212
cd ${DIR}
1313
PYTHON=python3
1414

necpp/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
)
2727
nec_sources.extend(glob("necpp_wrap.c"))
2828

29-
# config.h is generated from ./configure in the parent directory.
29+
# config.h is generated from cmake in the parent directory.
3030
#
3131
necpp_module = Extension(
3232
"_necpp",
3333
sources=nec_sources,
34-
include_dirs=["necpp_src/src/", "necpp_src/", "necpp_src/src/eigen3"],
34+
include_dirs=["necpp_src/src/", "necpp_src/", "necpp_src/build/", "necpp_src/src/eigen3"],
3535
define_macros=[("BUILD_PYTHON", "1")],
3636
)
3737

0 commit comments

Comments
 (0)