From 80a14bc7a06f3d2f694db0cec0c74b8265ec1c1a Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 21:55:22 +0200 Subject: [PATCH 01/16] rename libgpredict.h to gpredict.h --- libgpredict.h => gpredict.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename libgpredict.h => gpredict.h (100%) diff --git a/libgpredict.h b/gpredict.h similarity index 100% rename from libgpredict.h rename to gpredict.h From c8e66c592ae7dbb03653bcf2ae0d07b3ecdf3e35 Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 21:59:21 +0200 Subject: [PATCH 02/16] remove #include , trim whitespace glib/gi18n.h is not broadly available on mac os x and libgpredict does not need it --- gtk-sat-data.c | 13 ++++++------- orbit-tools.c | 15 +++++++-------- predict-tools.c | 49 ++++++++++++++++++++++++------------------------- qth-data.c | 7 +++---- sat-vis.h | 7 +++---- time-tools.c | 15 +++++++-------- tle-tools.c | 9 ++++----- 7 files changed, 54 insertions(+), 61 deletions(-) diff --git a/gtk-sat-data.c b/gtk-sat-data.c index d7b3770..2b5dceb 100644 --- a/gtk-sat-data.c +++ b/gtk-sat-data.c @@ -11,23 +11,22 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ #include -#include #include "sgpsdp/sgp4sdp4.h" #include "gtk-sat-data.h" #include "orbit-tools.h" @@ -86,7 +85,7 @@ gtk_sat_data_init_sat (sat_t *sat, qth_t *qth) while (sat_geodetic.lon < -pi) sat_geodetic.lon += twopi; - + while (sat_geodetic.lon > (pi)) sat_geodetic.lon -= twopi; @@ -182,7 +181,7 @@ void gtk_sat_data_copy_sat (const sat_t *source, sat_t *dest, qth_t *qth) /** \brief Free satellite data * \param sat Pointer to the satellite data to free - * + * * This function frees the memory that has been dyunamically allocated * when creating a new satellite object. */ @@ -202,7 +201,7 @@ void gtk_sat_data_free_sat(sat_t *sat) g_free(sat->website); sat->website=NULL; } - + g_free(sat); } } diff --git a/orbit-tools.c b/orbit-tools.c index 7004ce8..f53181d 100644 --- a/orbit-tools.c +++ b/orbit-tools.c @@ -13,23 +13,22 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ #include -#include #include "sgpsdp/sgp4sdp4.h" #include "orbit-tools.h" @@ -92,13 +91,13 @@ gboolean decayed (sat_t *sat) { - /* tle.xndt2o/(twopi/xmnpda/xmnpda) is the value before converted the + /* tle.xndt2o/(twopi/xmnpda/xmnpda) is the value before converted the value matches up with the value in predict 2.2.3 */ - /*** FIXME decayed is treated as a static quantity. - It is time dependent. Also sat->jul_utc is often zero + /*** FIXME decayed is treated as a static quantity. + It is time dependent. Also sat->jul_utc is often zero when this function is called ***/ - if (sat->jul_epoch + ((16.666666 - sat->meanmo) / + if (sat->jul_epoch + ((16.666666 - sat->meanmo) / (10.0 * fabs (sat->tle.xndt2o/(twopi/xmnpda/xmnpda)))) < sat->jul_utc) return TRUE; else diff --git a/predict-tools.c b/predict-tools.c index 4647fbf..4ce4d24 100644 --- a/predict-tools.c +++ b/predict-tools.c @@ -13,23 +13,22 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ #include -#include #include "sgpsdp/sgp4sdp4.h" /* #ifdef HAVE_CONFIG_H # include @@ -135,7 +134,7 @@ find_aos (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt) predict_calc (sat, qth, start); /* check whether satellite has aos */ - if ((sat->otype == ORBIT_TYPE_GEO) || + if ((sat->otype == ORBIT_TYPE_GEO) || (sat->otype == ORBIT_TYPE_DECAYED) || !has_aos (sat, qth)) { @@ -234,7 +233,7 @@ find_los (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt) predict_calc (sat, qth, start); /* check whether satellite has aos */ - if ((sat->otype == ORBIT_TYPE_GEO) || + if ((sat->otype == ORBIT_TYPE_GEO) || (sat->otype == ORBIT_TYPE_DECAYED) || !has_aos (sat, qth)) { @@ -265,10 +264,10 @@ find_los (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt) /* fine steps */ while ((lostime == 0.0) && (t <= (start + maxdt))) { - + t += sat->el * sqrt(sat->alt)/502500.0; predict_calc (sat, qth, t); - + if (fabs(sat->el) < 0.005) lostime = t; } @@ -285,10 +284,10 @@ find_los (sat_t *sat, qth_t *qth, gdouble start, gdouble maxdt) /* fine steps */ while (lostime == 0.0) { - + t += sat->el * sqrt(sat->alt)/502500.0; predict_calc (sat, qth, t); - + if (fabs(sat->el) < 0.005) lostime = t; } @@ -320,7 +319,7 @@ find_prev_aos (sat_t *sat, qth_t *qth, gdouble start) predict_calc (sat, qth, start); /* check whether satellite has aos */ - if ((sat->otype == ORBIT_TYPE_GEO) || + if ((sat->otype == ORBIT_TYPE_GEO) || (sat->otype == ORBIT_TYPE_DECAYED) || !has_aos (sat, qth)) { @@ -491,7 +490,7 @@ get_pass (sat_t *sat_in, qth_t *qth, gdouble start, gdouble maxdt) /* create a pass_t entry; FIXME: g_try_new in 2.8 */ pass = g_new (pass_t, 1); - + pass->aos = aos; pass->los = los; pass->max_el = 0.0; @@ -507,7 +506,7 @@ get_pass (sat_t *sat_in, qth_t *qth, gdouble start, gdouble maxdt) /* iterate over each time step */ for (t = pass->aos; t <= pass->los; t += step) { - + /* calculate satellite data */ predict_calc (sat, qth, t); @@ -693,7 +692,7 @@ copy_pass (pass_t *pass) new->vis[2] = pass->vis[2]; new->vis[3] = pass->vis[3]; new->details = copy_pass_details (pass->details); - + if (pass->satname != NULL) new->satname = g_strdup (pass->satname); else @@ -713,7 +712,7 @@ copy_pass_details (GSList *details) n = g_slist_length (details); for (i = 0; i < n; i++) { - new = g_slist_prepend (new, + new = g_slist_prepend (new, copy_pass_detail (PASS_DETAIL (g_slist_nth_data (details, i)))); } @@ -765,12 +764,12 @@ free_pass (pass_t *pass) { if (pass!=NULL){ free_pass_details (pass->details); - + if (pass->satname != NULL) { g_free (pass->satname); pass->satname = NULL; } - + g_free (pass); pass = NULL; } else { @@ -924,7 +923,7 @@ get_pass_no_min_el (sat_t *sat_in, qth_t *qth, gdouble start, gdouble maxdt) /* create a pass_t entry; FIXME: g_try_new in 2.8 */ pass = g_new (pass_t, 1); - + pass->aos = aos; pass->los = los; pass->max_el = 0.0; @@ -940,7 +939,7 @@ get_pass_no_min_el (sat_t *sat_in, qth_t *qth, gdouble start, gdouble maxdt) /* iterate over each time step */ for (t = pass->aos; t <= pass->los; t += step) { - + /* calculate satellite data */ predict_calc (sat, qth, t); @@ -991,7 +990,7 @@ get_pass_no_min_el (sat_t *sat_in, qth_t *qth, gdouble start, gdouble maxdt) default: break; } - + pass->details = g_slist_prepend (pass->details, detail); /* store elevation if greater than the @@ -1045,7 +1044,7 @@ get_current_pass (sat_t *sat_in, qth_t *qth, gdouble start) { gdouble t; sat_t *sat,sat_working; - + /*copy sat_in to a working structure*/ sat = memcpy(&sat_working,sat_in,sizeof(sat_t)); @@ -1053,15 +1052,15 @@ get_current_pass (sat_t *sat_in, qth_t *qth, gdouble start) t = start; else t = get_current_daynum (); - predict_calc (sat, qth, t); + predict_calc (sat, qth, t); /* check whether satellite has aos */ - if ((sat->otype == ORBIT_TYPE_GEO) || + if ((sat->otype == ORBIT_TYPE_GEO) || (sat->otype == ORBIT_TYPE_DECAYED) || !has_aos (sat, qth)) { - + return NULL; - + } /* find a time before AOS */ diff --git a/qth-data.c b/qth-data.c index dbc1dc3..90d547d 100644 --- a/qth-data.c +++ b/qth-data.c @@ -11,23 +11,22 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ #include -#include #include "sgpsdp/sgp4sdp4.h" #include "qth-data.h" #include "orbit-tools.h" diff --git a/sat-vis.h b/sat-vis.h index 96cc591..5350c3d 100644 --- a/sat-vis.h +++ b/sat-vis.h @@ -11,17 +11,17 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ @@ -30,7 +30,6 @@ #include -#include #include "sgpsdp/sgp4sdp4.h" #include "gtk-sat-data.h" diff --git a/time-tools.c b/time-tools.c index a48e5b3..239fe97 100644 --- a/time-tools.c +++ b/time-tools.c @@ -11,23 +11,22 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ #include -#include //#include #ifdef HAVE_CONFIG_H # include @@ -58,7 +57,7 @@ get_current_daynum () g_get_current_time (&tmval); daynum = Julian_Date (&utc); daynum = daynum + (double)tmval.tv_usec/8.64e+10; - + return daynum; } @@ -73,9 +72,9 @@ get_daynum_from_dmy (int d, int m, int y) double mm, yy; if (m<3) - { - y--; - m+=12; + { + y--; + m+=12; } if (y<57) diff --git a/tle-tools.c b/tle-tools.c index 582dc90..2edd448 100644 --- a/tle-tools.c +++ b/tle-tools.c @@ -13,23 +13,22 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ #include -#include #include "sgpsdp/sgp4sdp4.h" #include "sat-log.h" #ifdef HAVE_CONFIG_H @@ -47,7 +46,7 @@ * \param checksum Flag indicating whether to perform checksum check. * \param tle Pointer to a tle_t structure where the TLE data will be put. * \return TLE_CONV_SUCCESS if the conversion is successful or TLE_CONV_ERROR - * if an error has occurred during the conversion. + * if an error has occurred during the conversion. * * This function converts NASA 2-line orbital element data (as read from a tle * file) into a tle_t structure, which is used all over in gpredict. Note that From 5822a66b262f581fedb2b19e386ac67447ebf460 Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 22:01:16 +0200 Subject: [PATCH 03/16] remove "gi18n.h" N_ and _ macros --- sat-vis.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/sat-vis.c b/sat-vis.c index cc37e61..dcfec3c 100644 --- a/sat-vis.c +++ b/sat-vis.c @@ -11,23 +11,21 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ /** \brief Satellite visibility calculations. */ -/* #include */ -#include #include "sgpsdp/sgp4sdp4.h" #include "gtk-sat-data.h" #include "sat-vis.h" @@ -37,10 +35,10 @@ static gchar VIS2CHR[SAT_VIS_NUM] = { '-', 'V', 'D', 'E'}; static gchar *VIS2STR[SAT_VIS_NUM] = { - N_("Unknown"), - N_("Visible"), - N_("Daylight"), - N_("Eclipsed") + "Unknown", + "Visible", + "Daylight", + "Eclipsed" }; @@ -94,7 +92,7 @@ get_sat_vis (sat_t *sat, qth_t *qth, gdouble jul_utc) /* FIXME */ /* threshold = (gdouble) sat_cfg_get_int (SAT_CFG_INT_PRED_TWILIGHT_THLD); */ threshold = (gdouble) -6; - + if (sun_el <= threshold && sat->el >= 0.0) vis = SAT_VIS_VISIBLE; else @@ -125,6 +123,6 @@ vis_to_chr (sat_vis_t vis) gchar * vis_to_str (sat_vis_t vis) { - return g_strdup (_(VIS2STR[vis])); + return g_strdup (VIS2STR[vis]); } From 976db7b081bb952315dd9a83d088b688a32462fd Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 22:02:01 +0200 Subject: [PATCH 04/16] remove Makefile --- Makefile | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index d76512c..0000000 --- a/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -all: all-components libgpredict.a -all-components: sgpsdp/sgp_time.o sgpsdp/sgp_math.o sgpsdp/sgp4sdp4.o sgpsdp/sgp_in.o sgpsdp/sgp_obs.o sgpsdp/solar.o time-tools.o predict-tools.o gtk-sat-data.o orbit-tools.o qth-data.o sat-vis.o -sgpsdp/solar.o: - gcc -c sgpsdp/solar.c -Wall -o sgpsdp/solar.o `pkg-config --cflags --libs glib-2.0` -lm -sgpsdp/sgp_obs.o: - gcc -c sgpsdp/sgp_obs.c -Wall -o sgpsdp/sgp_obs.o `pkg-config --cflags --libs glib-2.0` -lm -sgpsdp/sgp_in.o: - gcc -c sgpsdp/sgp_in.c -Wall -o sgpsdp/sgp_in.o `pkg-config --cflags --libs glib-2.0` -lm -sgpsdp/sgp_time.o: - gcc -c sgpsdp/sgp_time.c -Wall -o sgpsdp/sgp_time.o `pkg-config --cflags --libs glib-2.0` -lm -sgpsdp/sgp_math.o: - gcc -c sgpsdp/sgp_math.c -Wall -o sgpsdp/sgp_math.o `pkg-config --cflags --libs glib-2.0` -lm -sgpsdp/sgp4sdp4.o: sgpsdp/sgp_math.o - gcc -c sgpsdp/sgp4sdp4.c -Wall -o sgpsdp/sgp4sdp4.o `pkg-config --cflags --libs glib-2.0` -lm -predict-tools.o: sgpsdp/sgp4sdp4.o - gcc -c predict-tools.c -Wall -o predict-tools.o `pkg-config --cflags --libs glib-2.0` -time-tools.o: sgpsdp/sgp4sdp4.o - gcc -c time-tools.c -Wall -o time-tools.o `pkg-config --cflags --libs glib-2.0` -orbit-tools.o: - gcc -c orbit-tools.c -Wall -o orbit-tools.o `pkg-config --cflags --libs glib-2.0` -gtk-sat-data.o: - gcc -c gtk-sat-data.c -Wall -o gtk-sat-data.o `pkg-config --cflags --libs glib-2.0` -qth-data.o: - gcc -c qth-data.c -Wall -o qth-data.o `pkg-config --cflags --libs glib-2.0` -sat-vis.o: - gcc -c sat-vis.c -Wall -o sat-vis.o `pkg-config --cflags --libs glib-2.0` -sgpsdp/test-001: libgpredict.a - gcc sgpsdp/test-001.c -Wall -o sgpsdp/test-001 -L. -lgpredict `pkg-config --cflags --libs glib-2.0` -lm -sgpsdp/test-002: libgpredict.a - gcc sgpsdp/test-002.c -Wall -o sgpsdp/test-002 -L. -lgpredict `pkg-config --cflags --libs glib-2.0` -lm -iss-test: libgpredict.a - gcc iss-test.c -Wall -o iss-test -L. -lgpredict `pkg-config --cflags --libs glib-2.0` -lm -test: sgpsdp/test-001 sgpsdp/test-002 iss-test - (cd sgpsdp; ./test-001; ./test-002; ../iss-test) -libgpredict.a: all-components - ar rcs libgpredict.a sgpsdp/sgp_time.o sgpsdp/sgp_math.o sgpsdp/sgp4sdp4.o sgpsdp/sgp_in.o sgpsdp/sgp_obs.o sgpsdp/solar.o predict-tools.o time-tools.o gtk-sat-data.o orbit-tools.o qth-data.o sat-vis.o - -clean: - rm -f `find . | egrep '(\.o$$|\.a$$)'` - rm -f sgpsdp/test-001 sgpsdp/test-002 iss-test From 6f1715b7c4ad670720f047dcc9b30b012bedb00f Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 22:08:07 +0200 Subject: [PATCH 05/16] implement cmake based make system --- .gitignore | 7 +-- CMakeLists.txt | 46 +++++++++++++++++ cmake/FindGlib.cmake | 120 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 cmake/FindGlib.cmake diff --git a/.gitignore b/.gitignore index 3f3d4ec..378eac2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1 @@ -libgpredict.a -sgpsdp/*.o -sgpsdp/test-001 -sgpsdp/test-002 -iss-test -*.o +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..cd845bb --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,46 @@ +cmake_minimum_required(VERSION 2.8) + +project (gpredict) +set(CMAKE_BUILD_TYPE Release) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") + +if(APPLE) + set(CMAKE_MACOSX_RPATH ON) +endif() + +# Glib +# cmake/FindGlib.cmake is taken from https://github.com/WebKit/webkit/blob/master/Source/cmake/FindGLIB.cmake +find_package(Glib REQUIRED) +include_directories(${GLIB_INCLUDE_DIR}) +include_directories(${GLIBCONFIG_INCLUDE_DIR}) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) +add_library(gpredict SHARED + sgpsdp/solar.c + sgpsdp/sgp_obs.c + sgpsdp/sgp_in.c + sgpsdp/sgp_time.c + sgpsdp/sgp_math.c + sgpsdp/sgp4sdp4.c + predict-tools.c + time-tools.c + orbit-tools.c + gtk-sat-data.c + qth-data.c + sat-vis.c +) + +# link glib +target_link_libraries(gpredict ${GLIB_LIBRARIES}) + +install (TARGETS gpredict + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin +) + +INSTALL(FILES + gpredict.h + DESTINATION "include/gpredict" + ) \ No newline at end of file diff --git a/cmake/FindGlib.cmake b/cmake/FindGlib.cmake new file mode 100644 index 0000000..599a4e3 --- /dev/null +++ b/cmake/FindGlib.cmake @@ -0,0 +1,120 @@ +# - Try to find Glib and its components (gio, gobject etc) +# Once done, this will define +# +# GLIB_FOUND - system has Glib +# GLIB_INCLUDE_DIRS - the Glib include directories +# GLIB_LIBRARIES - link these to use Glib +# +# Optionally, the COMPONENTS keyword can be passed to find_package() +# and Glib components can be looked for. Currently, the following +# components can be used, and they define the following variables if +# found: +# +# gio: GLIB_GIO_LIBRARIES +# gobject: GLIB_GOBJECT_LIBRARIES +# gmodule: GLIB_GMODULE_LIBRARIES +# gthread: GLIB_GTHREAD_LIBRARIES +# +# Note that the respective _INCLUDE_DIR variables are not set, since +# all headers are in the same directory as GLIB_INCLUDE_DIRS. +# +# Copyright (C) 2012 Raphael Kubo da Costa +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS +# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +find_package(PkgConfig) +pkg_check_modules(PC_GLIB QUIET glib-2.0) + +find_library(GLIB_LIBRARIES + NAMES glib-2.0 + HINTS ${PC_GLIB_LIBDIR} + ${PC_GLIB_LIBRARY_DIRS} +) + +# Files in glib's main include path may include glibconfig.h, which, +# for some odd reason, is normally in $LIBDIR/glib-2.0/include. +get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH) +find_path(GLIBCONFIG_INCLUDE_DIR + NAMES glibconfig.h + HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR} + ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0/include +) + +find_path(GLIB_INCLUDE_DIR + NAMES glib.h + HINTS ${PC_GLIB_INCLUDEDIR} + ${PC_GLIB_INCLUDE_DIRS} + PATH_SUFFIXES glib-2.0 +) + +set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR}) + +# Version detection +file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS) +string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") +set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}") +string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") +set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}") +string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}") +set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}") +set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}") + +# Additional Glib components. We only look for libraries, as not all of them +# have corresponding headers and all headers are installed alongside the main +# glib ones. +foreach (_component ${GLIB_FIND_COMPONENTS}) + if (${_component} STREQUAL "gio") + find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES) + elseif (${_component} STREQUAL "gobject") + find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES) + elseif (${_component} STREQUAL "gmodule") + find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES) + elseif (${_component} STREQUAL "gthread") + find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR}) + set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES) + elseif (${_component} STREQUAL "gio-unix") + # gio-unix is compiled as part of the gio library, but the include paths + # are separate from the shared glib ones. Since this is currently only used + # by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config. + pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0) + endif () +endforeach () + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS} + VERSION_VAR GLIB_VERSION) + +mark_as_advanced( + GLIBCONFIG_INCLUDE_DIR + GLIB_GIO_LIBRARIES + GLIB_GIO_UNIX_LIBRARIES + GLIB_GMODULE_LIBRARIES + GLIB_GOBJECT_LIBRARIES + GLIB_GTHREAD_LIBRARIES + GLIB_INCLUDE_DIR + GLIB_INCLUDE_DIRS + GLIB_LIBRARIES +) \ No newline at end of file From 6ec5e08bdfa3b304749847d15b56a764f47bd81f Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 22:18:55 +0200 Subject: [PATCH 06/16] move iss-test.c under test directory add cmake build script for it --- test/CMakeLists.txt | 22 ++++++++++++++++++++++ iss-test.c => test/iss-test.c | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 test/CMakeLists.txt rename iss-test.c => test/iss-test.c (98%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..353bf06 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 2.8.0 FATAL_ERROR) + +project(iss-test) + +add_executable(iss-test + iss-test.c +) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../cmake") + +# Glib +# cmake/FindGlib.cmake is taken from https://github.com/WebKit/webkit/blob/master/Source/cmake/FindGLIB.cmake +find_package(Glib REQUIRED) +include_directories(${GLIB_INCLUDE_DIR}) +include_directories(${GLIBCONFIG_INCLUDE_DIR}) + +target_link_libraries(iss-test gpredict) + +# sys math lib +target_link_libraries(iss-test m) + +install(TARGETS iss-test DESTINATION bin) \ No newline at end of file diff --git a/iss-test.c b/test/iss-test.c similarity index 98% rename from iss-test.c rename to test/iss-test.c index b37113d..325d77e 100644 --- a/iss-test.c +++ b/test/iss-test.c @@ -1,6 +1,6 @@ #include #include -#include "libgpredict.h" +#include "../gpredict.h" char tle_str[3][80]; sat_t sat; From d80a1d386926e93a7c7a86bed65c5915f39fe5d3 Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 22:27:45 +0200 Subject: [PATCH 07/16] remove commented out includes and some code also --- gtk-sat-data.c | 1 - orbit-tools.c | 1 - predict-tools.c | 5 ----- predict-tools.h | 8 +++----- qth-data.h | 7 +++---- sat-vis.c | 1 - sat-vis.h | 1 - time-tools.c | 39 --------------------------------------- time-tools.h | 7 +++---- tle-tools.c | 3 --- tle-tools.h | 7 +++---- 11 files changed, 12 insertions(+), 68 deletions(-) diff --git a/gtk-sat-data.c b/gtk-sat-data.c index 2b5dceb..0e9e453 100644 --- a/gtk-sat-data.c +++ b/gtk-sat-data.c @@ -33,7 +33,6 @@ #include "time-tools.h" - /** \brief Initialise satellite data. * \param sat The satellite to initialise. * \param qth Optional QTH info, use (0,0) if NULL. diff --git a/orbit-tools.c b/orbit-tools.c index f53181d..881ab05 100644 --- a/orbit-tools.c +++ b/orbit-tools.c @@ -33,7 +33,6 @@ #include "orbit-tools.h" - orbit_type_t get_orbit_type (sat_t *sat) { diff --git a/predict-tools.c b/predict-tools.c index 4ce4d24..ede8464 100644 --- a/predict-tools.c +++ b/predict-tools.c @@ -30,15 +30,10 @@ #include #include "sgpsdp/sgp4sdp4.h" -/* #ifdef HAVE_CONFIG_H -# include -#endif */ #include "gtk-sat-data.h" #include "time-tools.h" -/* #include "sat-cfg.h" */ #include "orbit-tools.h" #include "predict-tools.h" -/* #include "sat-log.h" */ /** \brief SGP4SDP4 driver for doing AOS/LOS calculations. diff --git a/predict-tools.h b/predict-tools.h index 42f0339..3f5177f 100644 --- a/predict-tools.h +++ b/predict-tools.h @@ -11,17 +11,17 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ @@ -34,8 +34,6 @@ #include "sat-vis.h" - - /** \brief Brief satellite pass info. */ typedef struct { gchar *satname; /*!< satellite name */ diff --git a/qth-data.h b/qth-data.h index a6445e4..86cca0d 100644 --- a/qth-data.h +++ b/qth-data.h @@ -11,17 +11,17 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ @@ -32,7 +32,6 @@ #include "sgpsdp/sgp4sdp4.h" - /** \brief QTH data structure in human readable form. */ typedef struct { gchar *name; /*!< Name, eg. callsign. */ diff --git a/sat-vis.c b/sat-vis.c index dcfec3c..e55f04a 100644 --- a/sat-vis.c +++ b/sat-vis.c @@ -29,7 +29,6 @@ #include "sgpsdp/sgp4sdp4.h" #include "gtk-sat-data.h" #include "sat-vis.h" -/* #include "sat-cfg.h" */ static gchar VIS2CHR[SAT_VIS_NUM] = { '-', 'V', 'D', 'E'}; diff --git a/sat-vis.h b/sat-vis.h index 5350c3d..de14f71 100644 --- a/sat-vis.h +++ b/sat-vis.h @@ -34,7 +34,6 @@ #include "gtk-sat-data.h" - /** \brief Satellite visibility. */ typedef enum { SAT_VIS_NONE = 0, /*!< Unknown/undefined. */ diff --git a/time-tools.c b/time-tools.c index 239fe97..2328d6f 100644 --- a/time-tools.c +++ b/time-tools.c @@ -27,17 +27,8 @@ */ #include -//#include -#ifdef HAVE_CONFIG_H -# include -#endif #include "sgpsdp/sgp4sdp4.h" #include "time-tools.h" -//#ifdef G_OS_WIN32 -//# include "libc_internal.h" -//# include "libc_interface.h" -//#endif - /** \brief Get the current time. @@ -48,43 +39,13 @@ gdouble get_current_daynum () { struct tm utc; - //struct timeval tmval; GTimeVal tmval; double daynum; UTC_Calendar_Now (&utc); - //gettimeofday (&tmval, NULL); g_get_current_time (&tmval); daynum = Julian_Date (&utc); daynum = daynum + (double)tmval.tv_usec/8.64e+10; return daynum; } - - -/* This function calculates the day number from m/d/y. */ -/* Legacy code no longer in use -long -get_daynum_from_dmy (int d, int m, int y) -{ - - long dn; - double mm, yy; - - if (m<3) - { - y--; - m+=12; - } - - if (y<57) - y+=100; - - yy=(double)y; - mm=(double)m; - dn=(long)(floor(365.25*(yy-80.0))-floor(19.0+yy/100.0)+floor(4.75+yy/400.0)-16.0); - dn+=d+30*m+(long)floor(0.6*mm-0.3); - - return dn; -} -*/ diff --git a/time-tools.h b/time-tools.h index 7b59fbc..a0408f8 100644 --- a/time-tools.h +++ b/time-tools.h @@ -11,17 +11,17 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ @@ -29,7 +29,6 @@ #define TIME_TOOLS_H 1 gdouble get_current_daynum (void); -//long get_daynum_from_dmy (int d, int m, int y); #endif diff --git a/tle-tools.c b/tle-tools.c index 2edd448..c1e57b4 100644 --- a/tle-tools.c +++ b/tle-tools.c @@ -31,9 +31,6 @@ #include #include "sgpsdp/sgp4sdp4.h" #include "sat-log.h" -#ifdef HAVE_CONFIG_H -# include -#endif #include "tle-tools.h" diff --git a/tle-tools.h b/tle-tools.h index 8d676f3..fe05367 100644 --- a/tle-tools.h +++ b/tle-tools.h @@ -11,17 +11,17 @@ More details can be found at the project home page: http://gpredict.oz9aec.net/ - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program; if not, visit http://www.fsf.org/ */ @@ -30,7 +30,6 @@ #include #include "sgpsdp/sgp4sdp4.h" -//#include "gtk-sat-data.h" enum { From c83356bb083bc01d3d1a215deca9c56703bd5295 Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 22:43:58 +0200 Subject: [PATCH 08/16] add building description to README --- README.md | 48 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 25bbe28..923f023 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,46 @@ -This is an attempt to take the prediction code from Gpredict and make it a -library for use with a PHP extension or other things. Not ready for consumption yet. +# libgpredict -Dependencies: +This is an attempt to take the prediction code out of Gpredict and make it a standalone dynamic +library. -On a stock ubuntu system, you may need to run: +## dependencies +### mac os x - sudo apt-get install make pkg-config libgtk2.0-dev + brew install glib -Once that's done, you should be able to run +### linux - make test + sudo apt-get install libglib2.0-dev + +## install + + git clone https://github.com/cubehub/libgpredict.git + cd libgpredict + mkdir build + cd build + cmake ../ + make + make install + +# test + + cd test + mkdir build + cd build + cmake ../ + make + ./iss-test + +It should print this: + +``` +Testing a single ISS prediction + +TLE Data OK + +Lat: 18.389813558938 (expected: 18.389606541458) +Lon: -36.880015960342 (expected: -36.879846099166) +Alt: 409.7429431026 (expected: 409.7429029679) +Footprint: 4454.9076239034 (expected: 4454.9074167831) +Velocity: 7.6691931516 (expected: 7.66919316690) +``` From 10b54db3933324a8d1d821257ab154c67ff8323a Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Fri, 27 Mar 2015 22:45:11 +0200 Subject: [PATCH 09/16] change test heading to second level --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 923f023..d0f550a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ library. make make install -# test +## test cd test mkdir build From 77a496b0bfd9664e92945984731740c41e6e6723 Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Wed, 1 Apr 2015 22:28:35 +0300 Subject: [PATCH 10/16] remove GKeyFile *data from qth_t struct --- qth-data.c | 5 ----- qth-data.h | 2 -- 2 files changed, 7 deletions(-) diff --git a/qth-data.c b/qth-data.c index 90d547d..c21e998 100644 --- a/qth-data.c +++ b/qth-data.c @@ -64,11 +64,6 @@ qth_data_free (qth_t *qth) qth->wx = NULL; } - if (qth->data) { - g_key_file_free (qth->data); - qth->data = NULL; - } - g_free (qth); } diff --git a/qth-data.h b/qth-data.h index 86cca0d..3a248b7 100644 --- a/qth-data.h +++ b/qth-data.h @@ -42,8 +42,6 @@ typedef struct { gint alt; /*!< Altitude above sea level in meters. */ gchar *qra; /*!< QRA locator */ gchar *wx; /*!< Weather station code (4 chars). */ - - GKeyFile *data; /*!< Raw data from cfg file. */ } qth_t; From b0dcead7aadd2b684592c5fc20f622658b68c63b Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Wed, 1 Apr 2015 22:30:29 +0300 Subject: [PATCH 11/16] remove obs_set_t and obs_astro_t from sat_t struct --- sgpsdp/sgp4sdp4.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sgpsdp/sgp4sdp4.h b/sgpsdp/sgp4sdp4.h index 555bd6b..8c05106 100644 --- a/sgpsdp/sgp4sdp4.h +++ b/sgpsdp/sgp4sdp4.h @@ -22,7 +22,7 @@ typedef enum { ORBIT_TYPE_UNKNOWN = 0, ORBIT_TYPE_LEO, /*!< Low Earth orbit, up to 1200 km. */ - ORBIT_TYPE_ICO, /*!< Intermediate Circular Orbit, up to 1400 km. */ + ORBIT_TYPE_ICO, /*!< Intermediate Circular Orbit, up to 1400 km. */ ORBIT_TYPE_GEO, /*!< Geostationary. */ ORBIT_TYPE_GSO, /*!< Geosynchronuous. */ ORBIT_TYPE_MOLNIYA, @@ -75,8 +75,8 @@ typedef struct { double xincl1; double xnodeo1; double omegao1; -} tle_t; - +} tle_t; + /** \brief Geodetic position data structure. * \ingroup sgpsdpif @@ -165,11 +165,6 @@ typedef struct { vector_t pos; /*!< Raw position and range */ vector_t vel; /*!< Raw velocity */ - /*** FIXME: REMOVE */ - obs_set_t bearing; /*!< Az, El, range and vel */ - obs_astro_t astro; /*!< Ra and Decl */ - /*** END */ - /* time keeping fields */ double jul_epoch; double jul_utc; @@ -209,7 +204,7 @@ typedef struct { #define e6a 1.0E-6 #define tothrd 6.6666667E-1 /* 2/3 */ #define xj2 1.0826158E-3 /* J2 Harmonic */ -#define xj3 -2.53881E-6 /* J3 Harmonic */ +#define xj3 -2.53881E-6 /* J3 Harmonic */ #define xj4 -1.65597E-6 /* J4 Harmonic */ #define xke 7.43669161E-2 #define xkmper 6.378135E3 /* Earth radius km */ @@ -218,7 +213,7 @@ typedef struct { #define ck2 5.413079E-4 #define ck4 6.209887E-7 #define __f 3.352779E-3 -#define ge 3.986008E5 +#define ge 3.986008E5 #define __s__ 1.012229 #define qoms2t 1.880279E-09 #define secday 8.6400E4 /* Seconds per day */ @@ -255,7 +250,7 @@ typedef struct { #define __sr__ 6.96000E5 /*Solar radius - kilometers (IAU 76)*/ #define AU 1.49597870E8 /*Astronomical unit - kilometers (IAU 76)*/ -/* Entry points of Deep() +/* Entry points of Deep() FIXME: Change to enu */ #define dpinit 1 /* Deep-space initialization code */ #define dpsec 2 /* Deep-space secular code */ From 1fe613ca555bbf7722adf4104b2c239e6291b7fc Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Tue, 12 May 2015 14:41:28 +0300 Subject: [PATCH 12/16] add missing header files --- CMakeLists.txt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd845bb..e20c6cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,5 +42,12 @@ install (TARGETS gpredict INSTALL(FILES gpredict.h + gtk-sat-data.h + orbit-tools.h + predict-tools.h + qth-data.h + sat-vis.h + sgpsdp/sgp4sdp4.h + time-tools.h DESTINATION "include/gpredict" - ) \ No newline at end of file + ) From 515b33806b7fc6998d23af7dbd20494e3ed61aaf Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Tue, 12 May 2015 17:31:41 +0300 Subject: [PATCH 13/16] install sgp4sdp4.h under sgpsdp --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e20c6cc..ffc3ab7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,10 @@ INSTALL(FILES predict-tools.h qth-data.h sat-vis.h - sgpsdp/sgp4sdp4.h time-tools.h DESTINATION "include/gpredict" ) +INSTALL(FILES + sgpsdp/sgp4sdp4.h + DESTINATION "include/gpredict/sgpsdp" + ) From c8d0d2842c9bb599a4f6300eebcba0e49d81812d Mon Sep 17 00:00:00 2001 From: Andres Vahter Date: Tue, 12 May 2015 17:32:06 +0300 Subject: [PATCH 14/16] mention ldconfig in README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d0f550a..5f08eef 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ library. cmake ../ make make install + sudo ldconfig # for linux ## test From 92fe10a1660deb7db82860a3d3b194ccd74946df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20H=C3=BCbner?= Date: Fri, 4 Jul 2025 15:51:49 +0200 Subject: [PATCH 15/16] CMake: Add option to build libgpredict static --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffc3ab7..0241f2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ cmake_minimum_required(VERSION 2.8) +option(BUILD_SHARED_LIBS "Build shared libraries" ON) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + project (gpredict) set(CMAKE_BUILD_TYPE Release) @@ -16,7 +19,7 @@ include_directories(${GLIB_INCLUDE_DIR}) include_directories(${GLIBCONFIG_INCLUDE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_library(gpredict SHARED +add_library(gpredict sgpsdp/solar.c sgpsdp/sgp_obs.c sgpsdp/sgp_in.c From 02b09b5bb7e94b6d0e9516e0c90841a3c6272823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20H=C3=BCbner?= Date: Fri, 4 Jul 2025 15:54:16 +0200 Subject: [PATCH 16/16] CMake: Enable building statically linked --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0241f2c..9d5bf13 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 2.8) -option(BUILD_SHARED_LIBS "Build shared libraries" ON) +# set to ON, to build libgpredict as .so +option(BUILD_SHARED_LIBS "Build shared libraries" OFF) set(CMAKE_POSITION_INDEPENDENT_CODE ON) project (gpredict)