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

Update WR using the master #268

Closed
wants to merge 35 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fa884bb
Merge pull request #58 from rgleason/frontend2
rgleason Jul 2, 2020
ecd376d
v1.13.9.2 pluginlocal add opencpn-
rgleason Jul 2, 2020
41959cb
frontend2 v1.0.124
rgleason Jul 4, 2020
1c7d322
v1.13.10.0
rgleason Jul 4, 2020
7b2d6cf
AboutDialog expand version number
rgleason Jul 4, 2020
91c515d
v1.13.11.0
rgleason Jul 4, 2020
ecd90d3
Correct tinyxml source file declaration
bdbcat Jul 9, 2020
f2b21ba
v1.13.12 Fix tinyxml + Set files
rgleason Jul 9, 2020
5d56f81
v1.13.13.0 tinyxml sub mod
rgleason Jul 9, 2020
051b2cf
add missing tinyxml libs
rgleason Jul 9, 2020
e249b79
build: Fix metadata location in tarball (#1976).
leamas Jul 10, 2020
86519a7
upload: Remove tarball cruft
leamas Jul 10, 2020
59fdd2f
flatpak: Build tinyxml in manifest.
leamas Jul 10, 2020
b4e2355
flatpak: Fix wrong tinyxml sha256-sum.
leamas Jul 10, 2020
d12f829
flatpak: Use a secondary git repo for tinyxml
leamas Jul 10, 2020
c891915
flatpak: adjust tinyxml build paths.
leamas Jul 10, 2020
f1f9e6c
flatpak: Fix tinyxml build recipe.
leamas Jul 10, 2020
ab7355a
flatpak: fix build recipe, part 2.
leamas Jul 10, 2020
a7dac86
flatpak: fix build recipe, part 3.
leamas Jul 10, 2020
49170c4
flatpak: fix build recipe, part 4.
leamas Jul 10, 2020
6e6d6c0
flatpak: build recipe, part 5.
leamas Jul 10, 2020
acb816c
v1.13.14.0 fix flatpak
rgleason Jul 11, 2020
62af566
Revert building in manifest, use a static library instead.
leamas Jul 11, 2020
ba98759
Add a proper RPATH (#1977).
leamas Jul 12, 2020
138cec8
cmake: Drop PluginXML.cmake
leamas Jul 12, 2020
f887172
v1.13.15.0 rm polars additional
rgleason Jul 15, 2020
02cd2e4
Merge branch 'master' of https://github.com/rgleason/weather_routing_pi
rgleason Jul 15, 2020
1c4cc24
v1.13.16.0 more flatpak chgs by leamas + rm polars additional
rgleason Jul 15, 2020
a901307
frontend2 1.0.132 update
rgleason Aug 3, 2020
df395f8
fix long description
rgleason Aug 3, 2020
162e204
v1.13.18.0
rgleason Aug 4, 2020
1f1dbea
v1.3.18.1 update odapi.h fix long short desc
rgleason Sep 3, 2020
d066fb6
v1.13.18.2 fix api-16 path
rgleason Sep 3, 2020
dde0849
v1.13.18.3 turn on json validation check USE_SVG
rgleason Sep 3, 2020
f301caa
v1.13.19.0 new odapi.h turn on json validation check use_svg
rgleason Sep 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
172 changes: 100 additions & 72 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@
## * xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx *
#-----------------------------------------------------------------------------
# Frontend2 Author: Jon Gough
# Frontend2: v1.0.120
# Frontend2: v1.0.132
# ---------------------------------------------------------------------------
## ----- When changing this file do NOT change the order in which sections occur ----- ##
## ----- Changes should only be made between the section blocks that identify where ----- ##
## ----- these changes should be. The whole configuration process relies on this ----- ##
## ----- sequence to be successful ----- ##


##
##----- Modify section below to include all the details for your plugin ----- ##
##

set(CMLOC "CMakeLists: ")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# define minimum cmake version
cmake_minimum_required(VERSION 3.1.1)
Expand All @@ -49,32 +51,33 @@ set(COMMON_NAME "WeatherRouting") # Search "getcommonname"in <plugin_pi>.cpp
set(TITLE_NAME "weatherrouting")
set(PACKAGE_CONTACT "Sean d'Epagnier")
set(PACKAGE "weather_routing_pi")
set(SHORT_DESCRIPTION "Compute optimal routes based on weather and constraints.")
set(LONG_DESCRIPTION "WR features include: optimal routing subject to various constraints based on weather data, automatic boat polar computation.")

set(VERSION_MAJOR "1")
set(VERSION_MINOR "13")
set(VERSION_PATCH "9")
set(VERSION_TWEAK "1")
set(VERSION_DATE "07/02/2020")
set(VERSION_PATCH "19")
set(VERSION_TWEAK "0")
set(VERSION_DATE "09/03/2020")
set(OCPN_MIN_VERSION "ov50")
set(OCPN_API_VERSION_MAJOR "1")
set(OCPN_API_VERSION_MINOR "16")

set(PARENT "opencpn")

#Used to set up a local webserver with git loaded, for testing purposes.
set(GIT_REPOSITORY_SERVER "github.com")
#Now set in plugin configure, needed to build flatpak, also locally.
#set(GIT_REPOSITORY_SERVER "github.com")

#No longer needed, queried.
set(GIT_USER "rgleason")
set(GIT_REPOSITORY_NAME "weather_routing_pi")
# set(GIT_USER "rgleason")
# set(GIT_REPOSITORY_NAME "weather_routing_pi")

## Specifies Cloudsmith upload repository suffix for each catalog
set(PROD "prod") #Standard Repos
set(BETA "beta") #Standard Repos
set(ALPHA "alpha") #Standard Repos

#set(CLOUDSMITH_USER "sean-depagnier")
#set(CLOUDSMITH_USER "jon-gough")
#set(CLOUDSMITH_USER "rick-gleason")
set(CLOUDSMITH_USER "opencpn")

Expand All @@ -85,14 +88,11 @@ set(CLOUDSMITH_BASE_REPOSITORY "weather-routing") #without the _pi

# Set Plugin info-url, summary and description
set(XML_INFO_URL "https://opencpn.org/OpenCPN/plugins/weatherroute.html")
set(XML_SUMMARY "Compute optimal routes based on weather and constraints.")
set(XML_DESCRIPTION "WR features include:\n\ optimal routing subject to various constraints based on weather data,\n\ automatic boat polar computation.")
set(XML_SUMMARY ${SHORT_DESCRIPTION})
set(XML_DESCRIPTION ${LONG_DESCRIPTION})

##
## ----- Modify section above to include all the details for your plugin ----- ##
##

##
## ----- Modify section below if there are special requirements for the plugin ----- ##
##

Expand All @@ -101,9 +101,9 @@ option(PLUGIN_USE_SVG "Use SVG graphics" ON)
set(CMAKE_CXX_STANDARD 11)

# Prefer libGL.so to libOpenGL.so, see CMP0072
set(OpenGL_GL_PREFERENCE "LEGACY")
#set(OpenGL_GL_PREFERENCE "LEGACY") #not operational
# Don't use local version of GLU library
set(USE_LOCAL_GLU FALSE)
#set(USE_LOCAL_GLU FALSE) #not operational
option(USE_GL "Enable OpenGL support" ON) #WxRoute requires on
message(STATUS "${CMLOC}USE_GL: ${USE_GL}")

Expand All @@ -121,38 +121,35 @@ message(STATUS "${CMLOC}Build type: ${CMAKE_BUILD_TYPE}")

project(${PACKAGE})


#========================================================
INCLUDE("cmake/PluginSetup.cmake")
include("PluginSetup")
#========================================================

##
## ----- The above is used to setup standard variables that are required by the CMAKE process - do not remove ----- ##
##

##
## ----- Modify section below if there are special requirements for the plugin ----- ##
##

set(CMAKE_VERBOSE_MAKEFILE ON)

option(Plugin_CXX11 "Use c++11" OFF) #Wass commented out
##
## ----- Modify section above if there are special requirements for the plugin ----- ##
##
option(Plugin_CXX11 "Use c++11" OFF)

##
## ----- Modify section above if there are special requirements for the plugin ----- ##
## ----- do not change next section - needed to configure build process ----- ##
##

#===========================================================
INCLUDE("cmake/PluginConfigure.cmake")
include("PluginConfigure")
#===========================================================
# ----- Change below to match project requirements for source, headers, etc. ----- ##
## ----- do not change section above - needed to configure build process ----- ##
## ----- Change below to match project requirements for source, headers, etc. ----- ##
#

add_definitions(-DUSE_S57)

# From master branch - is this workiing? necessary?
# From master branch - is this working? necessary?
IF(PLUGIN_USE_SVG)
MESSAGE(STATUS "${CMLOC}SVG support enabled...")
IF(NOT QT_ANDROID)
Expand Down Expand Up @@ -188,6 +185,8 @@ SET(SRCS
src/zuFile.cpp
src/georef.c
src/GribRecord.cpp

api-16/ocpn_plugin.h
)

# Added and tried by Rick
Expand Down Expand Up @@ -216,11 +215,11 @@ SET (HDRS
src/zuFile.h
src/georef.h
src/GribRecord.h
src/tinyxml/tinyxml.h
src/tinyxml/tinystr.h
src/jsoncpp/json/json.h
)
# Seems to work without this -Rick
# src/jsoncpp/json/json.h

# Tried removing this, got many Tesselate Linker errors. Put back in.
SET(SRC_LIBTESS2
src/libtess2/bucketalloc.c
src/libtess2/dict.c
Expand All @@ -230,19 +229,22 @@ SET(SRC_LIBTESS2
src/libtess2/sweep.c
src/libtess2/tess.c
)

SET(SRC_PLUGINGL
src/plugingl/linmath.h
src/plugingl/pidc.h
src/plugingl/qtstylesheet.h
src/plugingl/TexFont.h
)

# added by rick
SET (SRC_TINYXML
src/tinyxml/tinystr.h
src/tinyxml/tinyxml.h
)
# added by rick - removed by rick pluginJSON.cmake
# SET(SRC_PLUGINGL
# src/plugingl/linmath.h
# src/plugingl/pidc.h
# src/plugingl/qtstylesheet.h
# src/plugingl/TexFont.h
#)

# added by rick - removed by rick pluginTINYXML.cmake does this
# SET (SRC_TINYXML
# src/tinyxml/tinyxml.cpp
# src/tinyxml/tinyxmlerror.cpp
# src/tinyxml/tinyxmlparser.cpp
# src/tinyxml/tinyxml.h
#)

# SET (SRC_ZLIB
# src/zlib-1.2.3/zconf.h
Expand Down Expand Up @@ -280,24 +282,47 @@ SET(SRC_LIBTESS2
# src/jsoncpp/json_tool.h) #rick added

# Testplugin has this line, so just added it

add_definitions(-DPLUGIN_USE_SVG)

##================================================================================
## Required to collect all the set( headers and SRCS - Adjust as required
## This add_library can be used in conditionals below.
##================================================================================
SET(SRC ${SRCS} ${SRC_LIBTESS2} ${SRC_PLUGINGL} ${SRC_TINYXML})
# SET(SRC ${SRCS} ${SRC_LIBTESS2} ${SRC_PLUGINGL} ${SRC_TINYXML})
SET(SRC ${SRCS} ${SRC_LIBTESS2} )

##================================================================================
## JSON Validation
##================================================================================
if(APPLE)
option(PI_JSON_SCHEMA_VALIDATOR "Use JSON Schema validator" OFF)
else(APPLE)
option(PI_JSON_SCHEMA_VALIDATOR "Use JSON Schema validator" ON)
endif(APPLE)

if(PI_JSON_SCHEMA_VALIDATOR)
message(STATUS "${CMLOC}Using JSON Schema validation - warning this changes the 'flavour' of the executable and it may not be compatible with OpenCPN")
add_definitions(-DPI_JSON_SCHEMA_VALIDATOR)
message(STATUS "${CMLOC}Adding JSON Schema validation")
set(EXTSRC ${EXTSRC} extsrc/json-schema-validator/json-schema-draft7.json.cpp extsrc/json-schema-validator/json-uri.cpp extsrc/json-schema-validator/json-validator.cpp)
set(EXTINCLUDE ${EXTINCLUDE} extinclude/nlohmann/json.hpp extinclude/json-schema-validator/json-schema.hpp)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/extinclude/json-schema-validator)
else(PI_JSON_SCHEMA_VALIDATOR)
message(STATUS "${CMLOC}Not using JSON Schema validation - warning invalid #JSON 'may' cause unexpected crashes")
endif(PI_JSON_SCHEMA_VALIDATOR)


##=============================================================
# Modify/configure 'Include' Directories below for the Plugin
##=============================================================

#include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/)
#include_directories(BEFORE ${PROJECT_SOURCE_DIR}/libs/wx/include)
#include_directories(BEFORE ${PROJECT_SOURCE_DIR}/ocpninclude/wxcurl)
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/api-16)

##

## Statement below is required to collect all the set( headers and SRCS - Adjust as required
## This add_library can be used in conditionals below.
##
Expand All @@ -310,32 +335,35 @@ ADD_LIBRARY(${PACKAGE_NAME} SHARED ${SRC})
# Used in textplugin. Just added.
add_definitions(-DTIXML_USE_STL)

# Alec from watchdog
add_subdirectory(libs/tinyxml)
target_link_libraries(${PACKAGE_NAME} ocpn::tinyxml)

# -------------------------------------------
# PI_JSON SCHEMA VALIDATOR From Testplugin
# -------------------------------------------
# Every plugin that uses JSON for passing messages should use a validator. The validator allows the system to ignore non-conformant messages.

#if(UNIX AND NOT APPLE)
# if(PI_JSON_SCHEMA_VALIDATOR)
# # Change OS/ABI to be UNIX - System V to make it run with OCPN
# set(lib_name lib${PACKAGE_NAME}.so)
# message(STATUS "${CMLOC}lib-name: ${lib_name}")
# find_file(elfedit elfedit)
# if(NOT (${elfedit} STREQUAL "elfedit-NOTFOUND"))
# message(STATUS "${CMLOC}Will ensure OS/ABI is set to 0 to match OCPN")
# add_custom_command(
# TARGET ${PACKAGE_NAME}
# POST_BUILD
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
# DEPENDS ${PACKAGE_NAME}
# COMMENT " Running post build action on ${lib_name}."
# COMMAND sh -c 'elfedit --input-osabi=Linux --output-osabi=none ${lib_name} || (echo 0) ')
#
# else(NOT (${elfedit} STREQUAL "elfedit-NOTFOUND"))
# message(STATUS "${CMLOC}Cannot correct OS/ABI to match OCPN if it is generated incorrectly. Package binutils needed")
# endif(NOT (${elfedit} STREQUAL "elfedit-NOTFOUND"))
# endif(PI_JSON_SCHEMA_VALIDATOR)
#endif(UNIX AND NOT APPLE)
if(UNIX AND NOT APPLE)
if(PI_JSON_SCHEMA_VALIDATOR)
# Change OS/ABI to be UNIX - System V to make it run with OCPN
set(lib_name lib${PACKAGE_NAME}.so)
message(STATUS "${CMLOC}lib-name: ${lib_name}")
find_file(elfedit elfedit)
if(NOT (${elfedit} STREQUAL "elfedit-NOTFOUND"))
message(STATUS "${CMLOC}Will ensure OS/ABI is set to 0 to match OCPN")
add_custom_command(
TARGET ${PACKAGE_NAME}
POST_BUILD
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${PACKAGE_NAME}
COMMENT " Running post build action on ${lib_name}."
COMMAND sh -c 'elfedit --input-osabi=Linux --output-osabi=none ${lib_name} || (echo 0) ')
else(NOT (${elfedit} STREQUAL "elfedit-NOTFOUND"))
message(STATUS "${CMLOC}Cannot correct OS/ABI to match OCPN if it is generated incorrectly. Package binutils needed")
endif(NOT (${elfedit} STREQUAL "elfedit-NOTFOUND"))
endif(PI_JSON_SCHEMA_VALIDATOR)
endif(UNIX AND NOT APPLE)

# ------------------------------------------
# End of JSON VALIDATOR From Testplugin
Expand Down Expand Up @@ -383,19 +411,19 @@ ENDIF()

# Jon identified these were missing causing json/json.h and other problems.
#----INCLUDE CMAKE #3 & #4 -----
INCLUDE("cmake/PluginJSON.cmake")
INCLUDE("cmake/PluginXML.cmake")
INCLUDE("cmake/PluginGL.cmake")
include("PluginJSON")

# include("PluginXML") #Alec -added cmake_module and sub-directory. same as watchdog
include("PluginGL")
#
# ----- Do not change - needed to build app ----- ##
#
#INCLUDE CMAKE #5,6 & 7 -----
INCLUDE("cmake/PluginInstall.cmake")
INCLUDE("cmake/PluginLocalization.cmake")
INCLUDE("cmake/PluginPackage.cmake")
include("PluginInstall")
include("PluginLocalization")
include("PluginPackage")
get_target_property(OUT ${PACKAGE_NAME} LINK_LIBRARIES)
message(STATUS "${CMLOC}Libraries: ${OUT}")

## ----- do not change section above - needed to configure build process ----- ##
##

Loading