Skip to content

Commit

Permalink
Add optional url to de430.bsp download
Browse files Browse the repository at this point in the history
  • Loading branch information
patkenneally committed Jan 22, 2025
1 parent 344dbe8 commit 5eeee96
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
}
bskModuleOptionsString = {
"autoKey": "",
"pathToExternalModules": ""
"pathToExternalModules": "",
"url_spice_kernel": ""
}
bskModuleOptionsFlag = {
"clean": False,
Expand Down Expand Up @@ -251,6 +252,7 @@ def build(self):
cmake.definitions["CONAN_LINK_RUNTIME_MULTI"] = cmake.definitions["CONAN_LINK_RUNTIME"]
cmake.definitions["CONAN_LINK_RUNTIME"] = False
cmake.definitions["BUILD_OPNAV"] = self.options.opNav
if self.options.url_spice_kernel: cmake.definitions["URL_SPICE_KERNEL"] = self.options.url_spice_kernel
cmake.definitions["BUILD_VIZINTERFACE"] = self.options.vizInterface
cmake.definitions["EXTERNAL_MODULES_PATH"] = self.options.pathToExternalModules
cmake.definitions["PYTHON_VERSION"] = f"{sys.version_info.major}.{sys.version_info.minor}"
Expand Down
11 changes: 8 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,16 @@ FetchContent_MakeAvailable(googletest)
include(GoogleTest)
enable_testing()

# Check if the large Spice files are present. If not, download from JPL site directly
# Download spice file if not present
set(URL_SPICE_KERNEL
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de430.bsp"
CACHE
STRING
"URL from which to download spice kernel de430.bsp dependency")
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/../supportData/EphemerisData/de430.bsp")
message(STATUS "File de430.bsp not found, downloading file:")
message(STATUS "File de430.bsp not found, downloading file from ${URL_SPICE_KERNEL}:")
file(DOWNLOAD
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de430.bsp"
"${URL_SPICE_KERNEL}"
# Download it to the build directory (in case the download gets interrupted).
"${CMAKE_BINARY_DIR}/data/de430.bsp"
SHOW_PROGRESS
Expand Down

0 comments on commit 5eeee96

Please sign in to comment.