Skip to content

Commit

Permalink
Merge pull request #75 from rahil-makadia/dev
Browse files Browse the repository at this point in the history
update build binary file handling
  • Loading branch information
rahil-makadia authored Jul 11, 2024
2 parents fb88fd5 + 21564bf commit 54d0f18
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
python3 -m pip install --upgrade pip
sudo apt-get install pandoc doxygen
pip3 install "pybind11[global]>=2.10.0"
cd extern
python3 get_cspice.py
cd ..
pip3 install .
- name: Build docs
run: |
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ find_package(pybind11 REQUIRED)
pybind11_add_module(libgrss src/${PROJECT_NAME}.cpp)
target_link_libraries(libgrss PRIVATE ${PROJECT_NAME})

# copy the libgrss* files to the python package directory
file(GLOB LIBGRSS_FILES ${CMAKE_SOURCE_DIR}/build/libgrss.*)
file(COPY ${LIBGRSS_FILES} DESTINATION ${CMAKE_SOURCE_DIR}/grss)

# compile tests
add_subdirectory(tests/cpp/prop)

Expand Down
2 changes: 1 addition & 1 deletion grss/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.2
4.1.3
7 changes: 1 addition & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,9 @@ def build_extension(self, ext: CMakeExtension) -> None:
if not binary_created:
raise FileNotFoundError("libgrss binary for C++ source code not found "
"in cmake build directory")
os.system(f"cp {ext.sourcedir}/build/libgrss* {self.build_lib}/grss/")
os.system(f"cp {ext.sourcedir}/build/libgrss.* {self.build_lib}/grss/")
return

# run get_cspice in the extern folder if installing from source
if (not os.path.exists("./extern/cspice/lib/cspice.a") or
not os.path.exists("./extern/cspice/include/SpiceUsr.h") ):
subprocess.run(["python", "get_cspice.py"], cwd="./extern", check=True)

setup(
ext_modules=[CMakeExtension("libgrss")],
cmdclass={"build_ext": CMakeBuild}
Expand Down

0 comments on commit 54d0f18

Please sign in to comment.