Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake download bsp #328

Merged
merged 6 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ concurrency:

jobs:
pre-commit:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- id: file_changes
uses: tj-actions/changed-files@v44
- uses: pre-commit/[email protected]
with:
extra_args: --files ${{ steps.file_changes.outputs.all_changed_files}}
build-linux:
name: Build Linux
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: ["3.10"]
Expand All @@ -30,7 +32,7 @@ jobs:
security-events: write
steps:
- name: Checkout code
uses: nschloe/action-checkout-with-lfs-cache@v1
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down Expand Up @@ -101,7 +103,7 @@ jobs:
CONAN_USER_HOME_SHORT: None
steps:
- name: Checkout code
uses: nschloe/action-checkout-with-lfs-cache@v1
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ externalTools/fswAuto/autowrapper/wraps/*
**/outputFiles/*
src/moduleTemplates/autoCModule/*
src/moduleTemplates/autoCppModule/*

supportData/EphemerisData/de430.bsp
*.fdb_latexmk
*.fls

Expand Down
21 changes: 21 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,27 @@ FetchContent_MakeAvailable(googletest)
include(GoogleTest)
enable_testing()

# Check if the large Spice files are present. If not, download from JPL site directly
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/../supportData/EphemerisData/de430.bsp")
message(STATUS "File de430.bsp not found, downloading file:")
file(DOWNLOAD
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de430.bsp"
# Download it to the build directory (in case the download gets interrupted).
"${CMAKE_BINARY_DIR}/data/de430.bsp"
SHOW_PROGRESS
STATUS DOWNLOAD_RESULT
)
list(GET DOWNLOAD_RESULT 1 RESULT_MESSAGE)
list(GET DOWNLOAD_RESULT 0 RESULT_CODE)
if(NOT RESULT_CODE EQUAL 0)
message(FATAL_ERROR "Failed downloading de430.bsp with error code: ${RESULT_CODE} : ${RESULT_MESSAGE}.")
endif()
# Move the SPICE file into the appropriate directory.
file(RENAME "${CMAKE_BINARY_DIR}/data/de430.bsp" "${CMAKE_SOURCE_DIR}/../supportData/EphemerisData/de430.bsp")
else()
message(STATUS "Found Spice files.")
endif ()

# TODO: Remove the global link-libraries call
find_package(Eigen3 CONFIG REQUIRED)
# The following lines are necessary to prevent Xcode from issuing a warning about Eigen not being within the search
Expand Down
Binary file removed supportData/EphemerisData/de410.bsp
Binary file not shown.
Binary file removed supportData/EphemerisData/de421.bsp
Binary file not shown.
3 changes: 0 additions & 3 deletions supportData/EphemerisData/de430.bsp

This file was deleted.

Loading