Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
#11 DLL export for Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
irdvo committed Feb 16, 2021
1 parent 9c247c4 commit 99c57fd
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.0)
cmake_minimum_required(VERSION 2.9.0)

project(gpx)

Expand All @@ -14,7 +14,7 @@ IF(EXISTS "${CMAKE_SOURCE_DIR}/.git")
IF(GIT)
EXECUTE_PROCESS(
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${GIT} describe --tags
COMMAND ${GIT} describe --tags --always
OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT GIT_VERSION)
Expand Down
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
gpxlib
======
# gpxlib

A c++ library for parsing, browsing, changing and writing of GPX files.

See [gpxlib](http://irdvo.nl/gpxlib) for more information.


## Building

After cloning the project, goto the project build directory:

`cd gpxlib/build`

Run cmake for linux:

`cmake ..`

Run cmake for MinGW:

`cmake -G "MinGW Makefiles" ..`

Building static library:

`cmake -DBUILD_SHARED_LIBS=OFF ..`

Building dynamic library:

`cmake -DBUILD_SHARED_LIBS=ON ..`


## Tests

In the directory gpxlib/test there is test program (gpxtest).


## Examples

In the directory gpxlib/examples there are a few example programs.



2 changes: 2 additions & 0 deletions build/readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Directory for out-of-source builds

2 changes: 1 addition & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.0)
cmake_minimum_required(VERSION 2.9.0)

find_package(EXPAT REQUIRED)

Expand Down
11 changes: 6 additions & 5 deletions gpx/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
//
//==============================================================================

#include "gpx/export.h"

namespace gpx
{
Expand All @@ -37,7 +38,7 @@ namespace gpx
///
/// @return the value in radians
///
double deg2rad(double deg);
DLL_API double deg2rad(double deg);

///
/// Convert radians in degrees
Expand All @@ -46,7 +47,7 @@ namespace gpx
///
/// @return the value in degrees
///
double rad2deg(double rad);
DLL_API double rad2deg(double rad);

///
/// Calculate the distance between two lat-lon points
Expand All @@ -58,7 +59,7 @@ namespace gpx
///
/// @return the distance between the two points in metres
///
double distance(double lat1, double lon1, double lat2, double lon2);
DLL_API double distance(double lat1, double lon1, double lat2, double lon2);

///
/// Calculate the bearing between two lat-lon points
Expand All @@ -70,7 +71,7 @@ namespace gpx
///
/// @return the distance between the two points in metres
///
double bearing(double lat1, double lon1, double lat2, double lon2);
DLL_API double bearing(double lat1, double lon1, double lat2, double lon2);

///
/// Calculate the crosstrack distance between the lat-lon1 - lat-lon2 line and point lat-lon3
Expand All @@ -84,7 +85,7 @@ namespace gpx
///
/// @return the crosstrack distance between the line and the point in metres
///
double crosstrack(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3);
DLL_API double crosstrack(double lat1, double lon1, double lat2, double lon2, double lat3, double lon3);
}

#endif
Expand Down
2 changes: 1 addition & 1 deletion gpx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.0)
cmake_minimum_required(VERSION 2.9.0)

find_package(EXPAT REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.8.0)
cmake_minimum_required(VERSION 2.9.0)

find_package(EXPAT REQUIRED)

Expand Down

0 comments on commit 99c57fd

Please sign in to comment.