diff --git a/conanfile.py b/conanfile.py index b194db428..47ff04493 100644 --- a/conanfile.py +++ b/conanfile.py @@ -43,7 +43,8 @@ } bskModuleOptionsString = { "autoKey": "", - "pathToExternalModules": "" + "pathToExternalModules": "", + "url_spice_kernel": "" } bskModuleOptionsFlag = { "clean": False, @@ -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}" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3845a2186..40ae40c81 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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