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

Load stars from the HYG Star Database #4879

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,5 @@ result
.clangd/
.vscode/
*.code-workspace
# Custom star definitions generated as part of the build process.
data/systems/stars/hygdata_v3.*
9 changes: 9 additions & 0 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ Pioneer includes the following third-party software:
Copyright (C) 2016, Adi Shavit
Licensed under the BSD 3-clause license (see licenses/BSD-3-Clause.txt)

string-view lite, a C++17-like string_view for C++98 and later.
https://github.com/martinmoene/string-view-lite
Copyright 2017-2019 by Martin Moene
Distributed under the Boost Software License, Version 1.0. (see licenses/Boost-1.0.txt)

miniz by Rich Geldreich, April 2012
Public domain (see contrib/miniz/miniz.h)

Expand Down Expand Up @@ -177,6 +182,10 @@ Pioneer includes the following third-party software:
Copyright © 2013 Tomas Kislan, Adam Rudd
Licensed under the MIT License (see contrib/base64/base64.hpp)

fmt - open-source formatting library for C++
Copyright (c) 2012 - present, Victor Zverovich
Licensed under the MIT license

High Performance C++ Profiler
https://code.google.com/p/high-performance-cplusplus-profiler/
Licensed under the MIT license
Expand Down
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ add_subdirectory(contrib/fmt)
set(PIONEER_SRC ${CMAKE_SOURCE_DIR}/src)
set(PIONEER_CONTRIB ${CMAKE_SOURCE_DIR}/contrib)

set(PIONEER_SRC ${CMAKE_SOURCE_DIR}/src)
set(PIONEER_CONTRIB ${CMAKE_SOURCE_DIR}/contrib)

include_directories(
${PIONEER_SRC}
${PIONEER_CONTRIB}
Expand Down Expand Up @@ -333,6 +336,8 @@ target_link_libraries(${PROJECT_NAME} LINK_PRIVATE ${pioneerLibs} ${winLibs})
target_link_libraries(modelcompiler LINK_PRIVATE ${pioneerLibs} ${winLibs})
target_link_libraries(savegamedump LINK_PRIVATE pioneer-core ${SDL2_IMAGE_LIBRARIES} ${winLibs})

add_subdirectory(tools)

set_cxx11_properties(${PROJECT_NAME} modelcompiler savegamedump)

if(MSVC)
Expand All @@ -358,6 +363,7 @@ if (MODELCOMPILER)
if (NOT MSVC)
add_custom_target(build-models
COMMAND ${CMAKE_COMMAND} -E env SDL_VIDEODRIVER=dummy ${MODELCOMPILER} -b inplace
COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_BINARY_DIR}/.built-models
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Optimizing models" VERBATIM
)
Expand All @@ -367,6 +373,21 @@ else (MODELCOMPILER)
message(WARNING "No modelcompiler provided, models won't be optimized!")
endif(MODELCOMPILER)

set(HYG_DATABASE_FILE ${CMAKE_BINARY_DIR}/hygdata_v3.csv)
add_custom_command(OUTPUT ${HYG_DATABASE_FILE}
COMMAND curl https://raw.githubusercontent.com/astronexus/HYG-Database/master/hygdata_v3.csv
-o ${HYG_DATABASE_FILE} -z ${HYG_DATABASE_FILE}
COMMENT "Fetching HYG star database")

add_custom_target(build-hyg-data
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_SOURCE_DIR}/data/systems/stars
COMMAND hyg-database-parser --binary ${HYG_DATABASE_FILE}
-o ${CMAKE_SOURCE_DIR}/data/systems/stars/hygdata_v3.lz4
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${HYG_DATABASE_FILE}
COMMENT "Building HYG custom system file")
add_dependencies(build-data build-hyg-data)

install(TARGETS ${PROJECT_NAME} modelcompiler savegamedump
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
Expand Down
Loading