Skip to content
Commits on Source (7)
......@@ -21,6 +21,35 @@
## * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
## ***************************************************************************
#
# Configuring opencpn
# ===================
#
# Sound:
# - Without options, defaults to MswSound on Windows, PortAudioSound
# on Linux and WxSound on OSX.
# - With ENABLE_SYSTEM_CMD_SOUND enabled SystemCmdSound will the backend
# used on all platforms.
# - With ENABLE_PORTAUDIO activated PortAudioSound can be used on all
# platforms if the necessary headers and libraries are available.
# - ENABLE_SNDFILE adds libsndfile support to portaudio. libsndfile
# supports a wide range of audio formats instead of .wav only.
#
# Bundled libraries:
# - USE_BUNDLED_LIBS forces use of external/bundled libraries including
# wxsvg and liblz4.
# - If found, the system tinyxml library is used unconditionally.
# Documentation:
# - BUNDLE_DOCS governs inclusion of docs in the package.
# - Note that documentation is available in a separate download from
# opencpn website.
#
# Tidal/current and GSHHS wallpaper
# - BUNDLE_TCDATA (boolean) includes tide/current harmonics data in package
# - BUNDLE_GSHHS (NONE,MIN,[CRUDE],LOW,INTERMEDIATE,HIGH,FULL) governs the
# wallpaper map used as last resort and world overview.
#TODO:
# - cross platform compiling
# - test with Win & OSX
......@@ -30,16 +59,20 @@
# set /MT for Release build, and /MTd for debug.
# define minimum cmake version
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.2)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.1)
IF (COMMAND cmake_policy)
if (POLICY CMP0043)
CMAKE_POLICY(SET CMP0043 NEW)
endif (POLICY CMP0043)
if (POLICY CMP0025)
CMAKE_POLICY(SET CMP0025 NEW)
endif ()
ENDIF (COMMAND cmake_policy)
PROJECT(OpenCPN)
SET(CMAKE_VERBOSE_MAKEFILE ON)
message(STATUS "cmake version: ${CMAKE_VERSION}")
IF(APPLE)
SET(PACKAGE_NAME OpenCPN)
......@@ -47,7 +80,22 @@ ELSE(APPLE)
SET(PACKAGE_NAME opencpn)
ENDIF(APPLE)
OPTION(OCPN_USE_LIBCPP "Use C++11 and libc++ instead of libstdc++ on macOS" OFF)
IF(NOT MSVC)
SET(OBJ_VISIBILITY "-fvisibility=hidden" )
ENDIF()
# Locations where cmake looks for cmake modules.
SET(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/build
${CMAKE_SOURCE_DIR}/
${CMAKE_SOURCE_DIR}/cmake
)
set (CMAKE_CXX_STANDARD 11)
message(STATUS "Setting C++11 standard via cmake standard mechanism")
OPTION(OCPN_USE_LIBCPP "Use C++11 and libc++ instead of libstdc++ on macOS" ON)
if ( CMAKE_VERSION VERSION_GREATER 3.4 )
set(ENABLE_CLANG_TIDY OFF CACHE BOOL "Add clang-tidy automatically to builds")
......@@ -67,6 +115,15 @@ if ( CMAKE_VERSION VERSION_GREATER 3.4 )
endif()
endif()
# Add support for address etc sanitizers, part 1/2 (other half after ADD_EXECUTABLE)
if ( CMAKE_VERSION VERSION_GREATER 3.4 )
set(ENABLE_SANITIZER "none" CACHE STRING "Add clang sanitizer to the build")
set_property(CACHE ENABLE_SANITIZER PROPERTY STRINGS none address memory thread undefined)
if (NOT "${ENABLE_SANITIZER}" MATCHES "none")
add_compile_options(-fsanitize=${ENABLE_SANITIZER})
endif()
endif()
if ( CMAKE_VERSION VERSION_GREATER 3.9 )
set(ENABLE_CPPCHECK OFF CACHE BOOL "Add cppcheck automatically to builds")
if (ENABLE_CPPCHECK)
......@@ -76,7 +133,16 @@ if ( CMAKE_VERSION VERSION_GREATER 3.9 )
endif()
INCLUDE( ${CMAKE_SOURCE_DIR}/VERSION.cmake )
SET(PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
IF(OCPN_CI_BUILD)
INCLUDE(Utils)
TODAY(DATE)
COMMIT_ID(COMMIT)
SET(VERSION_TAIL "+${COMMIT}")
SET(VERSION_DATE "${DATE}")
ENDIF(OCPN_CI_BUILD)
SET(PACKAGE_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_TAIL}" )
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/version.h")
MESSAGE(FATAL_ERROR "There exists a relic 'include/version.h' in the source tree! Remove it.")
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/version.h")
......@@ -95,7 +161,7 @@ IF (NOT WIN32)
SET (LIB_INSTALL_DIR "lib")
IF (EXISTS /etc/debian_version)
SET (PACKAGE_FORMAT "DEB")
SET (PACKAGE_DEPS "libc6, libwxgtk3.0-0, wx3.0-i18n, libglu1-mesa (>= 7.0.0), libgl1-mesa-glx (>= 7.0.0), zlib1g, bzip2, libtinyxml2.6.2, libportaudio2")
SET (PACKAGE_DEPS "wx3.0-i18n (>= 3.0)")
SET (PACKAGE_RECS "xcalib,xdg-utils")
SET (LIB_INSTALL_DIR "lib")
IF (CMAKE_SYSTEM_PROCESSOR MATCHES "arm*")
......@@ -201,6 +267,13 @@ ELSE(APPLE OR WIN32)
SET(BUNDLE_GSHHS "NONE" CACHE STRING "Include GSHHS wallpaper map in package (NONE,MIN,[CRUDE],LOW,INTERMEDIATE,HIGH,FULL)")
ENDIF(APPLE OR WIN32)
IF(UNIX)
SET(USE_BUNDLED_LIBS "OFF" CACHE BOOL "Use bundled libraries instead of system's")
ELSE(UNIX)
SET(USE_BUNDLED_LIBS "ON" CACHE BOOL "Use bundled libraries instead of system's")
ENDIF(UNIX)
IF(APPLE OR WIN32)
IF(NOT BUNDLE_DOCS)
SET (BUNDLE_DOCS "ON")
......@@ -337,14 +410,23 @@ ENDIF()
IF((_wx_selected_config MATCHES "qt-armv7"))
SET(wxWidgets_USE_LIBS base core xml html adv aui)
ELSE()
SET(wxWidgets_USE_LIBS net xml html adv aui core base)
SET(wxWidgets_USE_LIBS net xml html adv aui core base webview)
ENDIF()
OPTION (USE_GL "Enable OpenGL support" ON)
# Prefer libGL.so to libOpenGL.so, see CMP0072
set (OpenGL_GL_PREFERENCE "LEGACY")
#set a build flag for arm architecture, to catch any rPI runtime changes required
IF (ARCH MATCHES "arm*" AND (NOT QT_ANDROID) )
ADD_DEFINITIONS(-DocpnARM)
ENDIF (ARCH MATCHES "arm*" AND (NOT QT_ANDROID) )
# Search for opengles, short of running a program to test the speed
# of acceleration, I simply use gles on "native linux" arm systems
IF (ARCH MATCHES "arm*" AND (NOT QT_ANDROID) )
IF (ARCH MATCHES "arm*" AND (NOT QT_ANDROID) AND CMAKE_SYSTEM_NAME MATCHES ".*Linux" )
find_path(OPENGLESv1_INCLUDE_DIR GLES/gl.h )
IF (OPENGLESv1_INCLUDE_DIR)
MESSAGE (STATUS "Found OpenGLESv1")
......@@ -375,10 +457,8 @@ IF(QT_ANDROID)
SET(wxWidgets_USE_LIBS ${wxWidgets_USE_LIBS} gl )
add_subdirectory(src/glshim)
ENDIF(QT_ANDROID)
IF ((NOT OPENGLES_FOUND) AND (NOT QT_ANDROID))
IF(USE_GL)
......@@ -388,7 +468,6 @@ ELSE(USE_GL)
ENDIF(USE_GL)
IF(OPENGL_FOUND)
SET(wxWidgets_USE_LIBS gl ${wxWidgets_USE_LIBS} )
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
......@@ -419,6 +498,16 @@ ENDIF()
MESSAGE (STATUS " Adding local GLU" )
add_subdirectory(src/glu)
SET( OPENGL_LIBRARIES "GLU_static" ${OPENGL_LIBRARIES})
MESSAGE (STATUS " Revised GL Lib (with local): " ${OPENGL_LIBRARIES})
MESSAGE (STATUS " Adding local LIBTESS2" )
add_subdirectory(src/libtess2)
SET( OPENGL_LIBRARIES "TESS2_static" ${OPENGL_LIBRARIES})
SET(EXTRA_LIBS ${EXTRA_LIBS} "TESS2_static")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/libtess2/Include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/libtess2/Source)
MESSAGE (STATUS " Revised EXTRA_LIBS (with local libtess2): " ${EXTRA_LIBS})
IF(NOT QT_ANDROID)
# Find wxWidgets here, and the setting get inherited by all plugins.
......@@ -432,17 +521,33 @@ set (WXWIDGETS_FORCE_VERSION CACHE VERSION "Force usage of a specific wxWidgets
if(WXWIDGETS_FORCE_VERSION)
set (wxWidgets_CONFIG_OPTIONS --version=${WXWIDGETS_FORCE_VERSION})
endif()
FIND_PACKAGE(wxWidgets REQUIRED)
IF(MSVC)
# Exclude wxexpat.lib, since we use our own version.
# Other things are excluded as well, but we don't need them
SET(wxWidgets_EXCLUDE_COMMON_LIBRARIES TRUE)
ENDIF(MSVC)
IF(WIN32 OR APPLE OR QT_ANDROID)
FIND_PACKAGE(wxWidgets)
if (wxWidgets_FOUND)
message(STATUS "Found wxWidgets webview add-on")
add_definitions(-DOCPN_USE_WEBVIEW)
else ()
list(REMOVE_ITEM wxWidgets_USE_LIBS webview)
message(STATUS "Could not find wxWidgets webview add-on")
FIND_PACKAGE(wxWidgets REQUIRED)
endif ()
IF(MSYS)
# this is to convert msys to windows paths, and handle the missing /usr
STRING( REGEX REPLACE "/usr/local" ";C:/MinGW/msys/1.0/local" wxWidgets_INCLUDE_DIRS ${wxWidgets_INCLUDE_DIRS} )
STRING( REGEX REPLACE "/usr/local" ";C:/MinGW/msys/1.0/local" wxWidgets_INCLUDE_DIRS "${wxWidgets_INCLUDE_DIRS}" )
ENDIF(MSYS)
INCLUDE(${wxWidgets_USE_FILE})
MESSAGE (STATUS "Found wxWidgets..." )
MESSAGE (STATUS " wxWidgets Includ: ${wxWidgets_INCLUDE_DIRS}")
MESSAGE (STATUS " wxWidgets Include: ${wxWidgets_INCLUDE_DIRS}")
MESSAGE (STATUS " wxWidgets Libraries: ${wxWidgets_LIBRARIES}")
ENDIF(WIN32 OR APPLE OR QT_ANDROID)
# We need to remove GLU from the wxWidgets_LIBRARIES list
# It only appears to get on the list for MSW...
......@@ -490,9 +595,13 @@ INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
IF(NOT WIN32 AND NOT APPLE )
ADD_DEFINITIONS( "-Wall -Wno-unused -fexceptions -rdynamic" )
ADD_DEFINITIONS( " -g -fno-strict-aliasing")
ADD_DEFINITIONS( " -Wno-unknown-pragmas")
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
ADD_DEFINITIONS( " -O0")
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
# TODO: Enable deprecation warnings again after the 5.0.0 cycle
ADD_DEFINITIONS(" -Wno-deprecated-declarations ")
# TODO: For libtess2, needs better handling after 5.0.0 cycle.
ADD_DEFINITIONS( " -DPREFIX=\\\"${CMAKE_INSTALL_PREFIX}\\\"")
# profiling with gprof
......@@ -515,9 +624,14 @@ IF( APPLE )
ADD_DEFINITIONS( " -D_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_" )
ENDIF(APPLE)
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang|AppleClang")
add_compile_options(-Wno-unknown-pragmas)
add_compile_options(-Wno-overloaded-virtual)
endif ()
#Enable CrashReporting for Windows (visual studio) and Linux
IF(MSVC OR (NOT APPLE AND NOT QT_ANDROID AND NOT MINGW))
OPTION (OCPN_USE_CRASHREPORT "Enable crash reporting" ON)
OPTION (OCPN_USE_CRASHREPORT "Enable crash reporting" OFF)
ELSE()
SET(OCPN_USE_CRASHREPORT FALSE)
ENDIF()
......@@ -534,8 +648,8 @@ IF(OCPN_USE_CRASHREPORT)
IF(CMAKE_BUILD_TYPE MATCHES "Rel*")
MESSAGE (STATUS "Using Linux crash reporting")
ADD_DEFINITIONS(-DLINUX_CRASHRPT)
ENDIF(CMAKE_BUILD_TYPE MATCHES "Rel*")
ENDIF(NOT APPLE AND NOT QT_ANDROID AND NOT MINGW)
ENDIF()
ENDIF()
ENDIF(MSVC)
ENDIF(OCPN_USE_CRASHREPORT)
......@@ -544,14 +658,9 @@ IF(MSVC)
ADD_DEFINITIONS(-D__MSVC__)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE)
ADD_DEFINITIONS(-DPSAPI_VERSION=1)
add_compile_options("-wd4068")
ENDIF(MSVC)
# Location where cmake first looks for cmake modules.
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/build)
# Let cmake find additional modules private to opencpn
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/")
IF (NOT WIN32 AND NOT APPLE)
IF(QT_ANDROID)
......@@ -566,8 +675,8 @@ IF(QT_ANDROID)
## Compiler flags
# if(CMAKE_COMPILER_IS_GNUCXX)
# set(CMAKE_CXX_FLAGS "-O2") ## Optimize
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
# endif()
set(CMAKE_EXE_LINKER_FLAGS "-s") ## Strip binary
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include/QtCore")
INCLUDE_DIRECTORIES("${Qt_Base}/android_armv7/include")
......@@ -583,30 +692,10 @@ IF(QT_ANDROID)
ENDIF(QT_ANDROID)
IF(UNIX AND NOT QT_ANDROID)
INCLUDE("FindPortaudio.cmake")
IF (PORTAUDIO_FOUND)
MESSAGE (STATUS "Portaudio Found")
INCLUDE_DIRECTORIES(${PORTAUDIO_INCLUDE_DIRS})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${PORTAUDIO_LIBRARIES})
ADD_DEFINITIONS(${PORTAUDIO_DEFINITIONS})
ADD_DEFINITIONS(-DOCPN_USE_PORTAUDIO)
ELSE (PORTAUDIO_FOUND)
MESSAGE (STATUS "Portaudio Not Found...")
ENDIF (PORTAUDIO_FOUND)
#SET(EXTRA_LIBS ${EXTRA_LIBS} "/usr/lib/i386-linux-gnu/libportaudio.so.2.0.0")
#ADD_DEFINITIONS(-DOCPN_USE_PORTAUDIO)
ENDIF(UNIX AND NOT QT_ANDROID)
ENDIF (NOT WIN32 AND NOT APPLE)
OPTION(OCPN_NEW_SERIAL "Use new serial communication implementation" ON)
IF( NOT APPLE )
SET(OCPN_NEW_SERIAL "OFF")
ENDIF( NOT APPLE )
IF(OCPN_NEW_SERIAL)
if(APPLE)
find_library(IOKIT_LIBRARY IOKit)
......@@ -647,7 +736,6 @@ IF(OCPN_NEW_SERIAL)
set(EXTRA_LIBS ${EXTRA_LIBS} SERIAL)
add_definitions(-DocpnUSE_NEWSERIAL)
message(STATUS "Using new serial library...")
ENDIF(OCPN_NEW_SERIAL)
......@@ -657,6 +745,16 @@ IF(OCPN_USE_CURL)
ADD_DEFINITIONS(-D__OCPN_USE_CURL__)
IF(WIN32)
INSTALL(FILES "${CMAKE_SOURCE_DIR}/buildwin/curl-ca-bundle.crt" "${CMAKE_SOURCE_DIR}/buildwin/libeay32.dll" "${CMAKE_SOURCE_DIR}/buildwin/ssleay32.dll" DESTINATION ".")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/buildwin/curl-ca-bundle.crt" DESTINATION ".")
IF(MSVC)
SET(CURL_LIBRARIES "${CMAKE_SOURCE_DIR}/buildwin/libcurl.lib")
INSTALL(FILES "buildwin/libcurl.dll" DESTINATION ".")
INSTALL(FILES "buildwin/zlib1.dll" DESTINATION ".")
ELSE(MSVC) ## mingw
SET(CURL_LIBRARIES "curl.dll")
INSTALL(FILES "buildwin/libcurl.dll" DESTINATION ".")
ENDIF(MSVC)
OPTION(OCPN_USE_EXTERN_CURL "Use external libcurl" OFF)
ELSE(WIN32)
SET(OCPN_USE_EXTERN_CURL ON)
......@@ -667,8 +765,8 @@ IF(NOT QT_ANDROID)
FIND_PACKAGE(CURL REQUIRED)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
ELSE(OCPN_USE_EXTERN_CURL)
INCLUDE("Curl.cmake")
MESSAGE (STATUS "Using local curl library...")
INCLUDE("Curl")
MESSAGE (STATUS "Using bundled curl library...")
ENDIF(OCPN_USE_EXTERN_CURL)
SET(SRC_WXCURL
src/wxcurl/base.cpp
......@@ -676,24 +774,30 @@ IF(NOT QT_ANDROID)
src/wxcurl/davtool.cpp
src/wxcurl/dialog.cpp
src/wxcurl/ftp.cpp
src/wxcurl/ftpparse.cpp
src/wxcurl/ftptool.cpp
src/wxcurl/http.cpp
src/wxcurl/panel.cpp
src/wxcurl/telnet.cpp
src/wxcurl/thread.cpp
src/wxcurl/utils.cpp
)
ADD_LIBRARY(WXCURL ${SRC_WXCURL})
INCLUDE( FindPkgConfig )
PKG_SEARCH_MODULE(SYS_WXCURL libwxcurl wxcurl)
IF (SYS_WXCURL_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
message (STATUS "Building with system wxcurl")
INCLUDE_DIRECTORIES(${SYS_WXCURL_INCLUDE_DIR})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${SYS_WXCURL_LIBRARIES})
ELSE (SYS_WXCURL_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
message (STATUS "Building with bundled wxcurl")
ADD_LIBRARY(WXCURL STATIC ${SRC_WXCURL})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxcurl)
SET(EXTRA_LIBS ${EXTRA_LIBS} WXCURL)
SET(EXTRA_LIBS ${EXTRA_LIBS} ${CURL_LIBRARIES})
ENDIF (SYS_WXCURL_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
MESSAGE (STATUS "wxCurl configured...")
SET(EXTRA_LIBS ${EXTRA_LIBS} ${CURL_LIBRARIES})
MESSAGE (STATUS "CURL_LIBRARIES:" ${CURL_LIBRARIES})
IF(WIN32 AND OCPN_USE_EXTERN_CURL)
find_library(CURL_LIBRARY_DLL NAMES
FIND_LIBRARY(CURL_LIBRARY_DLL NAMES
curl
curllib
libcurl_imp
......@@ -703,19 +807,13 @@ IF(NOT QT_ANDROID)
)
INSTALL(FILES ${CURL_LIBRARY_DLL} DESTINATION ".")
ENDIF(WIN32 AND OCPN_USE_EXTERN_CURL)
IF(WIN32)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/libssl-1_1.dll DESTINATION ".")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/libcrypto-1_1.dll DESTINATION ".")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/zlib.dll DESTINATION ".")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/zlib1.dll DESTINATION ".")
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/curl-ca-bundle.crt DESTINATION ".")
ENDIF(WIN32)
ENDIF(NOT QT_ANDROID)
ENDIF(OCPN_USE_CURL)
OPTION(OCPN_USE_SVG "Use SVG graphics" ON)
OPTION(OCPN_USE_LZMA "Use LZMA for chart compression" ON)
OPTION(OCPN_CI_BUILD "Use CI build versioning rules" OFF)
IF(OCPN_USE_SVG)
MESSAGE(STATUS "SVG support enabled...")
......@@ -741,10 +839,8 @@ IF(OCPN_USE_SVG)
PATHS ${CAIRO_INC_LOOK_PATHS}
PATH_SUFFIXES cairo/ libcairo/ cairo/libcairo/
${LOOK_OPTION} )
message(STATUS " Cairo include directory found: ${CAIRO_INCLUDE_DIR}")
SET(CAIRO_LIB_LOOK_PATHS /usr/lib /usr/local/lib /usr/lib/i386-linux-gnu)
IF(APPLE)
IF(NOT APPLE_MODERN)
......@@ -770,9 +866,9 @@ IF(OCPN_USE_SVG)
FIND_PACKAGE_HANDLE_STANDARD_ARGS( "CAIRO" DEFAULT_MSG CAIRO_INCLUDE_DIR CAIRO_LIBRARY )
MARK_AS_ADVANCED( CAIRO_INCLUDE_DIR CAIRO_LIBRARY )
if ( NOT CAIRO_FOUND )
IF ( NOT CAIRO_FOUND )
message(FATAL_ERROR "Cairo component required, but not found!")
endif()
ENDIF()
# Some systems (e.g ARMHF RPI2) require some extra libraries
# This is not exactly a general solution, but probably harmless where not needed.
......@@ -801,10 +897,10 @@ IF(OCPN_USE_SVG)
#set(VIDEO_FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${SWSCALE_LIBRARIES})
FIND_PACKAGE(EXPAT REQUIRED)
INCLUDE(FindEXIF.cmake)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/FindEXIF.cmake)
ELSE(NOT WIN32)
#On Windows, we have our own expat
SET(EXPAT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/buildwin/expat-2.1.0/include)
SET(EXPAT_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/buildwin/expat-2.2.5/include)
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
#And cairo
SET(CAIRO_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/buildwin/gtk/include)
......@@ -822,11 +918,12 @@ IF(OCPN_USE_SVG)
IF(WIN32)
SET(SVG_LIBS
${CMAKE_SOURCE_DIR}/buildwin/gtk/cairo.lib
${CMAKE_SOURCE_DIR}/buildwin/expat-2.1.0/expat.lib
${CMAKE_SOURCE_DIR}/buildwin/expat-2.2.5/expat.lib
${CMAKE_SOURCE_DIR}/buildwin/archive.lib
)
FILE(GLOB gtkdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/gtk/*.dll")
INSTALL(FILES ${gtkdll_files} DESTINATION ".")
FILE(GLOB expatdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/expat-2.1.0/*.dll")
FILE(GLOB expatdll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/expat-2.2.5/*.dll")
INSTALL(FILES ${expatdll_files} DESTINATION ".")
MESSAGE(STATUS "GTK and Expat DLLs bundled into the installer package...")
ELSE(WIN32)
......@@ -910,18 +1007,27 @@ IF(OCPN_USE_SVG)
src/wxsvg/src/svgxml/svgxmlhelpr.cpp
)
if(EXIF_FOUND)
SET(SRC_WXSVG ${SRC_WXSVG}
src/wxsvg/src/ExifHandler.cpp
)
SET(SRC_WXSVG ${SRC_WXSVG} src/wxsvg/src/ExifHandler.cpp)
ADD_DEFINITIONS(-DwxsvgUSE_EXIF)
INCLUDE_DIRECTORIES(${EXIF_INCLUDE_DIR})
endif()
ADD_LIBRARY(WXSVG ${SRC_WXSVG})
PKG_SEARCH_MODULE(WXSVG libwxsvg wxsvg)
IF (WXSVG_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
message (STATUS "Building with system wxsvg includes")
INCLUDE_DIRECTORIES(${WXSVG_INCLUDE_DIR})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${WXSVG_LIBRARIES})
ELSE (WXSVG_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
message (STATUS "Building with bundled wxsvg includes")
ADD_LIBRARY(WXSVG STATIC ${SRC_WXSVG})
TARGET_LINK_LIBRARIES(WXSVG ${SVG_LIBS})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/include/wxSVG)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/include/wxSVGXML)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/include)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/wxsvg/src)
set_property(TARGET WXSVG PROPERTY COMPILE_FLAGS "${OBJ_VISIBILITY}")
SET(EXTRA_LIBS ${EXTRA_LIBS} WXSVG)
ENDIF (WXSVG_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
ENDIF(NOT QT_ANDROID)
ENDIF(OCPN_USE_SVG)
......@@ -929,11 +1035,13 @@ ENDIF(OCPN_USE_SVG)
IF(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)
OPTION(OCPN_FORCE_GTK3 "Force the build to use GTK3" OFF)
IF(NOT OCPN_FORCE_GTK3)
FIND_PACKAGE(GTK2)
ENDIF(NOT OCPN_FORCE_GTK3)
IF(GTK2_FOUND)
set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk2)
INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
SET(GTK_LIBRARIES ${GTK2_LIBRARIES})
MESSAGE(STATUS "Building against GTK2...")
......@@ -941,12 +1049,91 @@ IF(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)
FIND_PACKAGE(GTK3)
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
SET(GTK_LIBRARIES ${GTK3_LIBRARIES})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__WXGTK3__")
set(wxWidgets_CONFIG_OPTIONS ${wxWidgets_CONFIG_OPTIONS} --toolkit=gtk3)
MESSAGE(STATUS "Building against GTK3...")
ENDIF(GTK2_FOUND)
FIND_PACKAGE(wxWidgets)
if (wxWidgets_FOUND)
message(STATUS "Found wxWidgets webview add-on")
add_definitions(-DOCPN_USE_WEBVIEW)
else ()
list(REMOVE_ITEM wxWidgets_USE_LIBS webview)
message(STATUS "Could not find wxWidgets webview add-on")
FIND_PACKAGE(wxWidgets REQUIRED)
endif ()
MESSAGE (STATUS "Found wxWidgets..." )
MESSAGE (STATUS " wxWidgets Include: ${wxWidgets_INCLUDE_DIRS}")
MESSAGE (STATUS " wxWidgets Libraries: ${wxWidgets_LIBRARIES}")
INCLUDE(${wxWidgets_USE_FILE})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${GTK_LIBRARIES})
ENDIF(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)
# SQLite3 support required for MBTiles.
set(SQLITECPP_SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/src/Backup.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/src/Column.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/src/Database.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/src/Exception.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/src/Statement.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/src/Transaction.cpp
)
# list of header files of the library
set(SQLITECPP_INC
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/SQLiteCpp.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Assertion.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Backup.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Column.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Database.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Exception.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Statement.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Transaction.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/Utils.h
${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/include/SQLiteCpp/VariadicBind.h
)
include_directories( src/SQLiteCpp/include src/SQLiteCpp/sqlite3 )
ADD_LIBRARY(SQLiteCpp STATIC ${SQLITECPP_SRC} ${SQLITECPP_INC})
set_property(TARGET SQLiteCpp PROPERTY COMPILE_FLAGS "${OBJ_VISIBILITY}")
SET(EXTRA_LIBS ${EXTRA_LIBS} SQLiteCpp)
IF(UNIX AND NOT APPLE)
SET(SQLITE3_INC_LOOK_PATHS /usr/local/include /usr/include )
FIND_PATH( SQLITE3_INCLUDE_DIR sqlite3.h
PATHS ${SQLITE3_INC_LOOK_PATHS})
message(STATUS " SQLite3 include directory found: ${SQLITE3_INCLUDE_DIR}")
SET(SQLITE3_LIB_LOOK_PATHS /usr/lib /usr/local/lib /usr/lib/i386-linux-gnu)
FIND_LIBRARY(SQLITE3_LIBRARY NAMES PATHS ${SQLITE3_LIB_LOOK_PATHS} NAMES sqlite3 libsqlite3)
message(STATUS " SQLite3 runtime library: ${SQLITE3_LIBRARY}")
IF( SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY )
MESSAGE(STATUS "Found SQLite3 dev environment.")
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
file(STRINGS "${SQLITE3_INCLUDE_DIR}/sqlite3.h" SQLITE3_VERSION_LINE REGEX "^[ \t]*#define[ \t]+SQLITE_VERSION_NUMBER[ \t]+[0-9]+.*$")
string(REGEX REPLACE "[ \t]*#define[ \t]+SQLITE_VERSION_NUMBER[ \t]+([0-9]+).*$" "\\1" SQLITE3_VERSION ${SQLITE3_VERSION_LINE})
MESSAGE(STATUS "SQLite3 version is ${SQLITE3_VERSION}")
IF( ${SQLITE3_VERSION} LESS "3019000" )
add_definitions(-DSQLITE_USE_LEGACY_STRUCT)
ENDIF( ${SQLITE3_VERSION} LESS "3019000" )
ELSE(SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
MESSAGE(STATUS "Could not find SQLite3 dev environment.")
MESSAGE(STATUS "Building local SQLite3 library.")
ADD_LIBRARY(sqlite3 STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/sqlite3/sqlite3.c ${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/sqlite3/sqlite3.h)
SET(EXTRA_LIBS ${EXTRA_LIBS} sqlite3)
ENDIF(SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
ENDIF(UNIX AND NOT APPLE)
IF(WIN32 OR APPLE)
ADD_LIBRARY(sqlite3 STATIC ${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/sqlite3/sqlite3.c ${CMAKE_CURRENT_SOURCE_DIR}/src/SQLiteCpp/sqlite3/sqlite3.h)
include_directories( src/SQLiteCpp/sqlite3 )
SET(EXTRA_LIBS ${EXTRA_LIBS} sqlite3)
ENDIF(WIN32 OR APPLE)
FIND_PACKAGE(Gettext REQUIRED)
......@@ -970,6 +1157,7 @@ IF(WIN32)
LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildwin")
LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/include")
ENDIF(WIN32)
IF(OCPN_USE_LZMA)
FIND_PACKAGE(LibLZMA)
IF(LIBLZMA_FOUND)
message (STATUS "Building with lzma support")
......@@ -978,6 +1166,81 @@ IF(LIBLZMA_FOUND)
ELSE(LIBLZMA_FOUND)
message (STATUS "lzma library not found")
ENDIF(LIBLZMA_FOUND)
ENDIF(OCPN_USE_LZMA)
#
# Sound setup
#
FIND_PROGRAM(APLAY aplay)
FIND_PROGRAM(AFPLAY afplay)
SET(SYSTEM_SOUND_CMD "\"\"")
IF (APLAY)
SET(SYSTEM_SOUND_CMD "\"aplay %s\"")
ELSEIF (AFPLAY)
SET(SYSTEM_SOUND_CMD "\"afplay %s\"")
ELSEIF (WIN32)
SET(SYSTEM_SOUND_CMD
"\"PowerShell (New-Object Media.SoundPlayer \\\\\\\"%s\\\\\\\").PlaySync();\"")
ENDIF ()
IF (APPLE)
SET (DEFAULT_SCS OFF)
ELSE (APPLE)
SET (DEFAULT_SCS ON)
ENDIF (APPLE)
OPTION(ENABLE_SYSTEM_CMD_SOUND
"Use aplay(1), afplay(1) etc. to play sounds if available" OFF)
SET (HAVE_SYSTEM_CMD_SOUND "")
IF (NOT (ENABLE_SYSTEM_CMD_SOUND MATCHES OFF))
IF (APLAY OR AFPLAY OR WIN32)
SET(HAVE_SYSTEM_CMD_SOUND 1)
ELSEIF (ENABLE_SYSTEM_CMD_SOUND MATCHES "ON")
MESSAGE(STATUS
"ENABLE_SYSTEM_CMD_SOUND is set but I cannot find aplay(1) or afplay(1)")
SET(HAVE_SYSTEM_CMD_SOUND "")
ENDIF()
ENDIF()
IF (WIN32 OR APPLE)
SET (DEFAULT_PA OFF)
ELSE (WIN32 OR APPLE)
SET (DEFAULT_PA ON)
ENDIF (WIN32 OR APPLE)
OPTION(ENABLE_PORTAUDIO
"Use portaudio(3) to play sounds if available" ${DEFAULT_PA})
SET (HAVE_PORTAUDIO "")
IF (NOT ENABLE_PORTAUDIO MATCHES OFF)
INCLUDE("FindPortaudio")
IF (PORTAUDIO_FOUND)
MESSAGE (STATUS "Portaudio Found")
INCLUDE_DIRECTORIES(${PORTAUDIO_INCLUDE_DIRS})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${PORTAUDIO_LIBRARIES})
ADD_DEFINITIONS(${PORTAUDIO_DEFINITIONS})
SET(HAVE_PORTAUDIO 1)
ELSEIF (ENABLE_PORTAUDIO MATCHES ON)
MESSAGE (STATUS "ENABLE_PORTAUDIO is set but I cannot find portaudio")
SET(HAVE_PORTAUDIO "")
ENDIF()
ENDIF ()
OPTION(ENABLE_SNDFILE
"Use libsndfile if available for sound files." ${DEFAULT_PA})
SET(HAVE_SNDFILE "")
IF (NOT ENABLE_SNDFILE MATCHES OFF)
INCLUDE(FindLibSndfile)
IF(LIBSNDFILE_FOUND)
MESSAGE (STATUS "libsndfile Found")
INCLUDE_DIRECTORIES(${LIBSNDFILE_INCLUDE_DIRS})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${LIBSNDFILE_LIBRARIES})
SET(HAVE_SNDFILE 1)
ELSEIF (ENABLE_SNDFILE MATCHES ON)
MESSAGE (STATUS "ENABLE_LIBSNDFILE is set but I cannot find libsndfile")
ENDIF()
ENDIF ()
# For convenience we define the sources as a variable. You can add
# header files and cpp/c files and CMake will sort them out
......@@ -1025,7 +1288,9 @@ SET(SRC_NMEA0183
src/nmea0183/xte.cpp
src/nmea0183/xte.hpp
)
ADD_LIBRARY(NMEA0183 ${SRC_NMEA0183})
ADD_LIBRARY(NMEA0183 STATIC ${SRC_NMEA0183})
set_property(TARGET NMEA0183 PROPERTY COMPILE_FLAGS "${OBJ_VISIBILITY}")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/nmea0183)
......@@ -1096,8 +1361,11 @@ SET(HDRS
include/FontMgr.h
include/FontDesc.h
include/vector2D.h
include/OCPNSoundData.h
include/OCPN_Sound.h
include/OcpnWxSound.h
include/SoundFactory.h
include/SoundLoaderFactory.h
include/SystemCmdSound.h
include/NMEALogWindow.h
include/WindowDestroyListener.h
include/TTYWindow.h
......@@ -1109,7 +1377,9 @@ SET(HDRS
include/navutil.h
include/routeman.h
include/routemanagerdialog.h
include/routeprop.h
include/MarkInfo.h
include/RoutePropDlg.h
include/RoutePropDlgImpl.h
include/routeprintout.h
include/trackprintout.h
include/PositionParser.h
......@@ -1128,11 +1398,11 @@ SET(HDRS
include/gshhs.h
include/kml.h
include/undo.h
include/about.h
include/AboutFrame.h
include/AboutFrameImpl.h
include/ais.h
include/pluginmanager.h
include/ocpn_plugin.h
include/gpxdocument.h
include/wx/json_defs.h
include/wx/jsonwriter.h
include/wx/jsonreader.h
......@@ -1148,6 +1418,7 @@ SET(HDRS
include/multiplexer.h
include/OCPNRegion.h
include/LLRegion.h
include/SoundFileLoader.h
include/TrackPropDlg.h
include/LinkPropDlg.h
include/viewport.h
......@@ -1156,6 +1427,8 @@ SET(HDRS
include/S57Sector.h
include/FlexHash.h
include/iENCToolbar.h
include/mbtiles.h
${CMAKE_BINARY_DIR}/include/config.h
)
SET(SRCS
......@@ -1192,8 +1465,12 @@ SET(SRCS
src/Select.cpp
src/FontMgr.cpp
src/FontDesc.cpp
src/OCPNSoundData.cpp
src/OCPN_Sound.cpp
src/OcpnWxSound.cpp
src/SoundFactory.cpp
src/SoundFileLoader.cpp
src/SoundLoaderFactory.cpp
src/SystemCmdSound.cpp
src/NMEALogWindow.cpp
src/TTYWindow.cpp
src/TTYScroll.cpp
......@@ -1205,7 +1482,9 @@ SET(SRCS
src/navutil.cpp
src/routeman.cpp
src/routemanagerdialog.cpp
src/routeprop.cpp
src/MarkInfo.cpp
src/RoutePropDlg.cpp
src/RoutePropDlgImpl.cpp
src/routeprintout.cpp
src/trackprintout.cpp
src/PositionParser.cpp
......@@ -1223,10 +1502,10 @@ SET(SRCS
src/gshhs.cpp
src/kml.cpp
src/undo.cpp
src/about.cpp
src/AboutFrame.cpp
src/AboutFrameImpl.cpp
src/ais.cpp
src/pluginmanager.cpp
src/gpxdocument.cpp
src/wxJSON/jsonwriter.cpp
src/wxJSON/jsonreader.cpp
src/wxJSON/jsonval.cpp
......@@ -1250,18 +1529,52 @@ SET(SRCS
src/OCPNPlatform.cpp
src/FlexHash.cpp
src/iENCToolbar.cpp
src/mbtiles.cpp
src/ConfigMgr.cpp
src/CanvasOptions.cpp
src/MUIBar.cpp
src/OCPN_AUIManager.cpp
src/CanvasConfig.cpp
)
IF(APPLE)
IF (DARWIN_VERSION LESS 16)
message(STATUS "DarkMode not included, requires Mac build host Darwin >= 16")
ELSE()
SET(SRCS ${SRCS}
src/DarkMode.mm
src/DarkMode.h
)
ADD_DEFINITIONS(-DOCPN_USE_DARKMODE)
ENDIF()
ENDIF(APPLE)
IF(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)
IF (WIN32)
list(APPEND SRCS src/MswSound.cpp)
list(APPEND HDRS include/MswSound.h)
ENDIF ()
IF(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID AND OCPN_USE_CRASHREPORT)
SET(HDRS ${HDRS} include/crashprint.h )
SET(SRCS ${SRCS} src/crashprint.cpp)
ENDIF(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID)
ENDIF(NOT WIN32 AND NOT APPLE AND NOT QT_ANDROID AND OCPN_USE_CRASHREPORT)
IF(QT_ANDROID)
SET(HDRS ${HDRS} include/androidUTIL.h)
SET(SRCS ${SRCS} src/androidUTIL.cpp)
SET(SRCS ${SRCS} src/AndroidSound.cpp)
SET(HDRS ${HDRS} include/AndroidSound.h)
ENDIF(QT_ANDROID)
IF (PORTAUDIO_FOUND)
SET(HDRS ${HDRS} include/PortAudioSound.h)
SET(SRCS ${SRCS} src/PortAudioSound.cpp)
ENDIF ()
IF (LIBSNDFILE_FOUND)
SET(HDRS ${HDRS} include/SndfileSoundLoader.h)
SET(SRCS ${SRCS} src/SndfileSoundLoader.cpp)
ENDIF ()
# Search for wxWidgets 2.9 or newer
STRING(REGEX MATCHALL "-2.9|-3." wx_Version_2.9+ "${wxWidgets_INCLUDE_DIRS}")
IF(wx_Version_2.9+)
......@@ -1296,17 +1609,16 @@ ENDIF(OPENGL_FOUND)
IF(TINYXML_FOUND)
message (STATUS "Building with tinyxml includes")
message (STATUS "Building with system tinyxml")
INCLUDE_DIRECTORIES(${TINYXML_INCLUDE_DIR})
ADD_DEFINITIONS(-DTIXML_USE_STL)
ELSE(TINYXML_FOUND)
message (STATUS "tinyxml library not found")
message (STATUS "Building with bundled tinyxml")
SET(SRCS ${SRCS} ${SRC_TINYXML})
ADD_DEFINITIONS(-DTIXML_USE_STL)
ENDIF(TINYXML_FOUND)
OPTION (USE_S57 "Enable S57 ENC support" ON)
IF (USE_S57)
message (STATUS "S57 ENC support: enabled")
......@@ -1331,6 +1643,8 @@ IF (USE_S57)
include/s57RegistrarMgr.h
src/s57RegistrarMgr.cpp
src/s57obj.cpp
src/SencManager.cpp
include/SencManager.h
src/myiso8211/ddffielddefn.cpp
src/myiso8211/ddfmodule.cpp
......@@ -1397,8 +1711,9 @@ IF (USE_S57)
src/mygdal/s57reader.cpp
src/mygdal/gdal_misc.cpp
)
ADD_LIBRARY(S57ENC ${SRC_S57ENC})
ADD_LIBRARY(S57ENC STATIC ${SRC_S57ENC})
INCLUDE_DIRECTORIES(BEFORE ${CMAKE_SOURCE_DIR}/src/mygdal)
set_property(TARGET S57ENC PROPERTY COMPILE_FLAGS "${OBJ_VISIBILITY}")
SET(EXTRA_LIBS ${EXTRA_LIBS} S57ENC)
ELSE (USE_S57)
......@@ -1454,14 +1769,15 @@ IF (USE_GARMINHOST)
)
IF(WIN32)
SET(SRC_GARMINHOST ${SRC_GARMINHOST} src/garmin/jeeps/gpsusbwin.c)
ENDIF(WIN32)
ENDIF()
ADD_LIBRARY(GARMINHOST ${SRC_GARMINHOST})
ADD_LIBRARY(GARMINHOST STATIC ${SRC_GARMINHOST})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/garmin/jeeps)
set_property(TARGET GARMINHOST PROPERTY COMPILE_FLAGS "${OBJ_VISIBILITY}")
SET(EXTRA_LIBS ${EXTRA_LIBS} GARMINHOST)
IF(WIN32)
ADD_DEFINITIONS(-D__WIN32__)
ENDIF(WIN32)
ENDIF()
ELSE (USE_GARMINHOST)
message (STATUS "Garmin Host Mode support: disabled")
ENDIF (USE_GARMINHOST)
......@@ -1470,22 +1786,16 @@ ENDIF (USE_GARMINHOST)
SET(SRC_SYMBOLS
src/chartsymbols.cpp
include/chartsymbols.h
src/razdsparser.cpp
include/razdsparser.h
)
ADD_LIBRARY(SYMBOLS ${SRC_SYMBOLS})
ADD_LIBRARY(SYMBOLS STATIC ${SRC_SYMBOLS})
set_property(TARGET SYMBOLS PROPERTY COMPILE_FLAGS "${OBJ_VISIBILITY}")
SET(EXTRA_LIBS ${EXTRA_LIBS} SYMBOLS)
# Compile texcompression support library
IF (OPENGL_FOUND)
SET(SRC_TEXCMP
src/texcmp/lz4/lz4.c
src/texcmp/lz4/lz4hc.c
src/texcmp/squish/alpha.cpp
src/texcmp/squish/clusterfit.cpp
src/texcmp/squish/colourblock.cpp
......@@ -1497,12 +1807,24 @@ IF (OPENGL_FOUND)
src/texcmp/squish/singlecolourfitfast.cpp
src/texcmp/squish/twocolourfitfast.cpp
src/texcmp/squish/squish.cpp
src/texcmp/etcpak.cpp)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/texcmp/lz4)
src/texcmp/etcpak.cpp
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/texcmp/squish)
PKG_SEARCH_MODULE(LZ4 liblz4 lz4)
IF (LZ4_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
message (STATUS "Building with system lz4")
INCLUDE_DIRECTORIES(${LZ4_INCLUDE_DIR})
SET(EXTRA_LIBS ${EXTRA_LIBS} ${LZ4_LIBRARIES})
ELSE (LZ4_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
message (STATUS "Building with bundled lz4")
SET(SRC_TEXCMP ${SRC_TEXCMP}
src/texcmp/lz4/lz4.c
src/texcmp/lz4/lz4hc.c
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/texcmp/lz4)
ENDIF (LZ4_FOUND AND USE_BUNDLED_LIBS MATCHES "OFF")
ADD_LIBRARY(TEXCMP ${SRC_TEXCMP})
ADD_LIBRARY(TEXCMP STATIC ${SRC_TEXCMP})
SET(EXTRA_LIBS ${EXTRA_LIBS} TEXCMP)
# always use optimizations for the texture compression which is much faster
......@@ -1511,7 +1833,7 @@ IF (OPENGL_FOUND)
IF (( ARCH MATCHES "i386" OR ARCH MATCHES "amd64" OR ARCH MATCHES "x86_64") AND NOT QT_ANDROID)
# using sse which makes the compression run about 50% faster
message (STATUS "Compiling texture compression library with sse support")
set_property(TARGET TEXCMP PROPERTY COMPILE_FLAGS "-O3 -msse2 -DSQUISH_USE_SSE=2 -fPIC")
set_property(TARGET TEXCMP PROPERTY COMPILE_FLAGS "-fvisibility=hidden -O3 -msse2 -DSQUISH_USE_SSE=2 -fPIC")
ELSE ()
# use standard optimizations for other architectures
set_property(TARGET TEXCMP PROPERTY COMPILE_FLAGS "-O3 -fPIC")
......@@ -1535,12 +1857,12 @@ IF (OPENGL_FOUND)
src/mipmap/mipmap_avx2.c
src/mipmap/mipmap_neon.c)
ADD_LIBRARY(MIPMAP ${SRC_MIPMAP})
ADD_LIBRARY(MIPMAP STATIC ${SRC_MIPMAP})
SET(EXTRA_LIBS ${EXTRA_LIBS} MIPMAP)
# always use optimizations for the texture compression which is much faster
IF ( NOT MSVC )
set_property(TARGET MIPMAP PROPERTY COMPILE_FLAGS "-O3")
set_property(TARGET MIPMAP PROPERTY COMPILE_FLAGS "-fvisibility=hidden -O3")
IF (( ARCH MATCHES "i386" OR ARCH MATCHES "amd64" OR ARCH MATCHES "x86_64") AND NOT QT_ANDROID)
set_source_files_properties(src/mipmap/mipmap_sse.c PROPERTIES COMPILE_FLAGS "-msse")
......@@ -1595,6 +1917,8 @@ ENDIF (OPENGL_FOUND)
# AC_SUBST(GL_CFLAGS)
#fi
CONFIGURE_FILE(config.h.in ${CMAKE_BINARY_DIR}/include/config.h)
INCLUDE_DIRECTORIES(BEFORE "${CMAKE_BINARY_DIR}/include")
# If we build for windows systems, we also include the resource file
# containing the manifest, icon and other resources
......@@ -1672,6 +1996,14 @@ SET(uiData
src/bitmaps/iconUserStd.png
src/bitmaps/iconAll.png
src/bitmaps/DragHandle.svg
src/bitmaps/eye.svg
src/bitmaps/eyex.svg
src/bitmaps/iENC_All.svg
src/bitmaps/iENC_Minimum.svg
src/bitmaps/iENC_Standard.svg
src/bitmaps/iENC_UserStd.svg
src/bitmaps/iENC_RPlus.svg
src/bitmaps/iENC_RMinus.svg
)
IF (USE_S57)
......@@ -1739,18 +2071,18 @@ ENDIF(xAPPLE)
IF(WIN32)
IF(MSVC)
SET(CMAKE_C_FLAGS_DEBUG "/MDd /Ob0 /Od /D_DEBUG /Zi /RTC1" )
SET(CMAKE_C_FLAGS_MINSIZEREL "/MD /O1 /Ob1 /D NDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "/MD /O2 /Ob2 /D NDEBUG /Zi")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob1 /D NDEBUG /Zi")
SET(CMAKE_CXX_FLAGS_DEBUG "/MDd /Ob0 /Od /D_DEBUG /Zi /RTC1 /EHa")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1 /Ob1 /D NDEBUG /EHa")
SET(CMAKE_CXX_FLAGS_RELEASE "/MD /O2 /Ob2 /D NDEBUG /Zi /EHa")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob1 /D NDEBUG /Zi /EHa" )
SET(CMAKE_C_FLAGS_DEBUG "/MP /MDd /Ob0 /Od /D_DEBUG /Zi /RTC1" )
SET(CMAKE_C_FLAGS_MINSIZEREL "/MP /MD /O1 /Ob1 /D NDEBUG")
SET(CMAKE_C_FLAGS_RELEASE "/MP /MD /O2 /Ob2 /D NDEBUG /Zi")
SET(CMAKE_C_FLAGS_RELWITHDEBINFO "/MP /MD /O2 /Ob1 /D NDEBUG /Zi")
SET(CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Ob0 /Od /D_DEBUG /Zi /RTC1 /EHa")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "/MP /MD /O1 /Ob1 /D NDEBUG /EHa")
SET(CMAKE_CXX_FLAGS_RELEASE "/MP /MD /O2 /Ob2 /D NDEBUG /Zi /EHa")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MP /MD /O2 /Ob1 /D NDEBUG /Zi /EHa" )
SET(CMAKE_EXE_LINKER_FLAGS /DEBUG)
ENDIF(MSVC)
ADD_EXECUTABLE(${PACKAGE_NAME} WIN32 ${HDRS} ${SRCS})
target_sources(${PACKAGE_NAME} PRIVATE app.manifest)
ENDIF(WIN32)
......@@ -1759,7 +2091,7 @@ IF(APPLE)
IF(NOT BUNDLE_GSHHS MATCHES "NONE")
SET_SOURCE_FILES_PROPERTIES(
${gshhs} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/gshhs )
ENDIF(NOT BUNDLE_GSHHS MATCHES "NONE")
ENDIF()
SET_SOURCE_FILES_PROPERTIES(
${uiData} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/uidata )
......@@ -1771,7 +2103,13 @@ SET_SOURCE_FILES_PROPERTIES(
ENDIF(BUNDLE_TCDATA MATCHES "ON")
SET_SOURCE_FILES_PROPERTIES(
data/license.txt PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport )
data/license.html PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport )
SET_SOURCE_FILES_PROPERTIES(
data/authors.html PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport )
SET_SOURCE_FILES_PROPERTIES(
data/opencpn.png PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport )
SET_SOURCE_FILES_PROPERTIES(
data/CoC-909_2013-InlandECDIS_20170308.pdf PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport )
......@@ -1782,38 +2120,53 @@ FOREACH (_currentSoundFile ${SOUND_FILES})
${_currentSoundFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/sounds )
ENDFOREACH (_currentSoundFile )
FILE(GLOB CONFIG_FILES ${CMAKE_SOURCE_DIR}/data/configs/*)
FOREACH (_currentConfigFile ${CONFIG_FILES})
SET_SOURCE_FILES_PROPERTIES(
${_currentConfigFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/configs )
ENDFOREACH (_currentConfigFile )
IF(OCPN_USE_SVG)
#Traditional theme SVG icons
FILE(GLOB TRADITIONAL_SVG_FILES "${CMAKE_SOURCE_DIR}/data/svg/traditional/*")
FOREACH (_currentSvgFile ${TRADITIONAL_SVG_FILES})
SET_SOURCE_FILES_PROPERTIES(
${_currentSvgFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/uidata/traditional )
ENDFOREACH (_currentSvgFile )
ENDFOREACH ()
#Journeyman theme SVG icons
FILE(GLOB JOURNEYMAN_SVG_FILES "${CMAKE_SOURCE_DIR}/data/svg/journeyman/*")
FOREACH (_currentSvgFile ${JOURNEYMAN_SVG_FILES})
SET_SOURCE_FILES_PROPERTIES(
${_currentSvgFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/uidata/journeyman )
ENDFOREACH (_currentSvgFile )
ENDFOREACH ()
#Journeyman_flat theme SVG icons
FILE(GLOB JOURNEYMAN_FLAT_SVG_FILES "${CMAKE_SOURCE_DIR}/data/svg/journeyman_flat/*")
FOREACH (_currentSvgFile ${JOURNEYMAN_FLAT_SVG_FILES})
SET_SOURCE_FILES_PROPERTIES(
${_currentSvgFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/uidata/journeyman_flat )
ENDFOREACH ()
#MUI_flat theme SVG icons
FILE(GLOB MUI_FLAT_SVG_FILES "${CMAKE_SOURCE_DIR}/data/svg/MUI_flat/*")
FOREACH (_currentSvgFile ${MUI_FLAT_SVG_FILES})
SET_SOURCE_FILES_PROPERTIES(
${_currentSvgFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/uidata/MUI_flat )
ENDFOREACH (_currentSvgFile )
#Default SVG Icons
FILE(GLOB DEFAULT_ICON_SVG_FILES "${CMAKE_SOURCE_DIR}/data/svg/markicons/*")
FOREACH (_currentSvgFile ${DEFAULT_ICON_SVG_FILES})
SET_SOURCE_FILES_PROPERTIES( ${_currentSvgFile} PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/uidata/markicons )
ENDFOREACH (_currentSvgFile )
ENDFOREACH ()
ENDIF(OCPN_USE_SVG)
INSTALL(DIRECTORY data/svg/markicons/ DESTINATION ${PREFIX_PKGDATA}/uidata/markicons)
INSTALL(DIRECTORY data/svg/MUI_flat/ DESTINATION ${PREFIX_PKGDATA}/uidata/MUI_flat)
SET_SOURCE_FILES_PROPERTIES( data/doc/help_web.html PROPERTIES MACOSX_PACKAGE_LOCATION SharedSupport/doc )
IF(BUNDLE_DOCS MATCHES "ON")
......@@ -1854,9 +2207,7 @@ IF(BUNDLE_DOCS MATCHES "ON")
${WIKI_DOC_FILES}
)
ELSE(BUNDLE_DOCS MATCHES "ON")
SET(DOC_FILES
data/doc/help_web.html
)
SET(DOC_FILES data/doc/help_web.html)
ENDIF(BUNDLE_DOCS MATCHES "ON")
ADD_EXECUTABLE(${PACKAGE_NAME} MACOSX_BUNDLE
......@@ -1866,7 +2217,9 @@ ADD_EXECUTABLE(${PACKAGE_NAME} MACOSX_BUNDLE
${uiData}
${s57data}
${tcData}
data/license.txt
data/license.html
data/authors.html
data/opencpn.png
data/CoC-909_2013-InlandECDIS_20170308s.pdf
${SOUND_FILES}
buildosx/opencpn.icns
......@@ -1875,7 +2228,9 @@ ADD_EXECUTABLE(${PACKAGE_NAME} MACOSX_BUNDLE
${JOURNEYMAN_SVG_FILES}
${JOURNEYMAN_FLAT_SVG_FILES}
${DEFAULT_ICON_SVG_FILES}
${MUI_FLAT_SVG_FILES}
${DOC_FILES}
${CONFIG_FILES}
)
INSTALL(TARGETS
......@@ -1901,19 +2256,19 @@ IF(QT_ANDROID)
ADD_LIBRARY(gorp ${HDRS} ${SRCS}
${SRC_NMEA0183}
${SRC_S57ENC}
# ${SRC_GARMINHOST}
${SRC_TEXCMP}
${SRC_MIPMAP}
${SRC_SYMBOLS}
)
TARGET_LINK_LIBRARIES( gorp ${wxWidgets_LIBRARIES} )
ENDIF()
# Sanitizers, part 2/2
if ( CMAKE_VERSION VERSION_GREATER 3.4 )
if (NOT "${ENABLE_SANITIZER}" MATCHES "none")
target_link_libraries(${PACKAGE_NAME} -fsanitize=${ENABLE_SANITIZER})
endif()
endif()
If(NOT APPLE AND NOT QT_ANDROID)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
......@@ -1921,7 +2276,7 @@ TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
${EXTRA_LIBS}
${wxWidgets_LIBRARIES}
)
ENDIF(NOT APPLE AND NOT QT_ANDROID)
ENDIF()
IF(WIN32)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
......@@ -1934,7 +2289,7 @@ TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
# use gdi plus only on MSVC, it is not a free library
IF(MSVC)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME} gdiplus.lib)
ENDIF(MSVC)
ENDIF()
IF(MINGW)
# assuming wxwidgets is compiled with unicode, this is needed for mingw headers
......@@ -1955,21 +2310,22 @@ TARGET_LINK_LIBRARIES(${PACKAGE_NAME}
${GETTEXT_LIBRARY}
${BZIP2_LIBRARIES}
${ZLIB_LIBRARY}
SQLiteCpp
sqlite3
)
IF(X11_FOUND AND NOT APPLE)
ADD_DEFINITIONS(-DOCPN_HAVE_X11)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME} ${X11_LIBRARIES} )
ENDIF(X11_FOUND AND NOT APPLE)
ENDIF()
IF(NOT APPLE AND NOT QT_ANDROID AND NOT WIN32 AND NOT X11_FOUND)
MESSAGE(STATUS "Did not find x11 libraries, support for transparent toolbar in opengl mode cannot be detected")
ENDIF()
IF(TINYXML_FOUND)
TARGET_LINK_LIBRARIES(${PACKAGE_NAME} ${TINYXML_LIBRARIES} )
ENDIF(TINYXML_FOUND)
ENDIF()
ENDIF(UNIX)
IF(LIBLZMA_FOUND)
......@@ -1978,9 +2334,9 @@ ENDIF(LIBLZMA_FOUND)
# Certain older Cmake FindGTK2 modules ( e.g. cmake-2.8.0-2) do not yield all of the required link libraries
# So, add them manually. These declarations may be redundant in some architectures, but do no harm.
IF(UNIX)
IF(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
TARGET_LINK_LIBRARIES( ${PACKAGE_NAME} dl )
ENDIF(UNIX)
ENDIF(CMAKE_SYSTEM_NAME MATCHES ".*Linux")
IF( UNIX AND NOT APPLE )
......@@ -1993,25 +2349,25 @@ IF( UNIX AND NOT APPLE )
TARGET_COMPILE_DEFINITIONS( ${PACKAGE_NAME} PUBLIC USE_LIBELF )
TARGET_INCLUDE_DIRECTORIES( ${PACKAGE_NAME} PUBLIC "${LIBELF_INCLUDE_DIR}" )
TARGET_LINK_LIBRARIES( ${PACKAGE_NAME} "${LIBELF_LIBRARY}" )
ELSE( LIBELF_INCLUDE_DIR AND LIBELF_LIBRARY )
ELSE()
MESSAGE( WARNING "Did not found LibELF, plugin compatibility check will be simplified." )
ENDIF( LIBELF_INCLUDE_DIR AND LIBELF_LIBRARY )
ENDIF ()
ENDIF( UNIX AND NOT APPLE )
IF(NOT APPLE)
IF(WIN32)
INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME DESTINATION ".")
ENDIF(WIN32)
ENDIF()
IF(UNIX AND NOT APPLE AND NOT QT_ANDROID)
INSTALL(TARGETS ${PACKAGE_NAME} RUNTIME DESTINATION ${PREFIX_BIN} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
ENDIF(UNIX AND NOT APPLE AND NOT QT_ANDROID)
INSTALL(FILES LINUX_DEVICES.md DESTINATION ${PREFIX_DATA}/${PACKAGE_NAME})
ENDIF()
IF(WIN32)
SET(PREFIX_PKGDATA ".")
ENDIF(WIN32)
ENDIF()
IF(NOT BUNDLE_GSHHS MATCHES "NONE")
INSTALL(FILES ${gshhs} DESTINATION ${PREFIX_PKGDATA}/gshhs PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
......@@ -2025,20 +2381,27 @@ IF(OCPN_USE_SVG)
INSTALL(DIRECTORY data/svg/traditional/ DESTINATION ${PREFIX_PKGDATA}/uidata/traditional)
INSTALL(DIRECTORY data/svg/journeyman/ DESTINATION ${PREFIX_PKGDATA}/uidata/journeyman)
INSTALL(DIRECTORY data/svg/journeyman_flat/ DESTINATION ${PREFIX_PKGDATA}/uidata/journeyman_flat)
INSTALL(DIRECTORY data/svg/MUI_flat/ DESTINATION ${PREFIX_PKGDATA}/uidata/MUI_flat)
ENDIF(OCPN_USE_SVG)
IF (USE_S57)
INSTALL(FILES ${s57data} DESTINATION ${PREFIX_PKGDATA}/s57data PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
ENDIF (USE_S57)
ENDIF ()
IF(BUNDLE_TCDATA MATCHES "ON")
INSTALL(FILES ${tcData} DESTINATION ${PREFIX_PKGDATA}/tcdata PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
ENDIF(BUNDLE_TCDATA MATCHES "ON")
ENDIF()
FILE(GLOB LICENSES "${CMAKE_SOURCE_DIR}/COPYING.*")
INSTALL(FILES ${LICENSES} LICENSING DESTINATION "${PREFIX_PKGDATA}")
INSTALL(FILES data/license.txt DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/CoC-909_2013-InlandECDIS_20170308s.pdf DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/copyright DESTINATION ${PREFIX_DATA}/doc/${PACKAGE_NAME} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/license.html DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/authors.html DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/opencpn.png DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
IF(PACKAGE_FORMAT EQUAL "DEB")
INSTALL(FILES data/changelog.gz DESTINATION ${PREFIX_DATA}/doc/${PACKAGE_NAME} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
ELSE(PACKAGE_FORMAT EQUAL "DEB")
......@@ -2055,8 +2418,11 @@ ENDIF(BUNDLE_DOCS MATCHES "ON")
IF(UNIX)
INSTALL(FILES data/opencpn.png DESTINATION ${PREFIX_DATA}/icons/hicolor/48x48/apps PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES src/bitmaps/opencpn-64.png DESTINATION ${PREFIX_DATA}/icons/hicolor/64x64/apps RENAME opencpn.png PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES src/bitmaps/other_svg_src/opencpn.svg DESTINATION ${PREFIX_DATA}/icons/hicolor/scalable/apps PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES data/opencpn.desktop DESTINATION ${PREFIX_DATA}/applications PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ )
INSTALL(FILES data/opencpn.appdata.xml DESTINATION ${PREFIX_DATA}/appdata PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ )
INSTALL(FILES opencpn.1 DESTINATION ${PREFIX_DATA}/man/man1 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ )
ENDIF(UNIX)
ENDIF(NOT APPLE)
......@@ -2104,9 +2470,7 @@ MACRO(GETTEXT_UPDATE_PO _potFile)
DEPENDS ${_absPotFile} ${_absFile}
COMMENT "po-update [${_poBasename}]: Updated po file."
)
SET(_poFiles ${_poFiles} ${_absFile}.dummy)
ENDFOREACH (_currentPoFile )
ADD_CUSTOM_TARGET(po-update COMMENT "po-update: Done." DEPENDS ${_poFiles})
......@@ -2115,7 +2479,7 @@ ENDMACRO(GETTEXT_UPDATE_PO)
IF (GETTEXT_MSGMERGE_EXECUTABLE)
FILE(GLOB PACKAGE_PO_FILES ${CMAKE_SOURCE_DIR}/po/*.po)
GETTEXT_UPDATE_PO(${CMAKE_SOURCE_DIR}/po/${PACKAGE_NAME}.pot ${PACKAGE_PO_FILES})
ENDIF(GETTEXT_MSGMERGE_EXECUTABLE)
ENDIF()
SET(_gmoFiles)
MACRO(GETTEXT_BUILD_MO _poFile _lang)
......@@ -2132,10 +2496,16 @@ MACRO(GETTEXT_BUILD_MO _poFile _lang)
COMMENT "i18n [${_poBasename}]: Created mo file."
)
IF(APPLE)
INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/OpenCPN.app/Contents/Resources/${_lang}.lproj RENAME ${PACKAGE_NAME}.mo )
ELSE(APPLE)
INSTALL(FILES ${_gmoFile} DESTINATION ${PREFIX_DATA}/locale/${_lang}/LC_MESSAGES RENAME ${PACKAGE_NAME}.mo PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
ENDIF(APPLE)
INSTALL(FILES ${_gmoFile} DESTINATION
${CMAKE_INSTALL_PREFIX}/bin/OpenCPN.app/Contents/Resources/${_lang}.lproj
RENAME ${PACKAGE_NAME}.mo
)
ELSE()
INSTALL(FILES ${_gmoFile} DESTINATION
${PREFIX_DATA}/locale/${_lang}/LC_MESSAGES RENAME ${PACKAGE_NAME}.mo
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
ENDIF()
SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
ENDMACRO(GETTEXT_BUILD_MO)
......@@ -2159,6 +2529,7 @@ GETTEXT_BUILD_MO(po/opencpn_tr_TR.po tr_TR)
GETTEXT_BUILD_MO(po/opencpn_fi_FI.po fi_FI)
GETTEXT_BUILD_MO(po/opencpn_el_GR.po el_GR)
GETTEXT_BUILD_MO(po/opencpn_zh_TW.po zh_TW)
GETTEXT_BUILD_MO(po/opencpn_zh_CN.po zh_TW)
GETTEXT_BUILD_MO(po/opencpn_hu_HU.po hu_HU)
GETTEXT_BUILD_MO(po/opencpn_gl_ES.po gl_ES)
GETTEXT_BUILD_MO(po/opencpn_ca_ES.po ca_ES)
......@@ -2169,7 +2540,7 @@ ADD_CUSTOM_TARGET(i18n COMMENT "i18n: Done." DEPENDS ${_gmoFiles})
IF(NOT QT_ANDROID)
ADD_DEPENDENCIES(${PACKAGE_NAME} i18n)
ENDIF(NOT QT_ANDROID)
ENDIF()
ENDIF(GETTEXT_MSGFMT_EXECUTABLE)
......@@ -2184,9 +2555,16 @@ IF(WIN32 OR APPLE)
GET_FILENAME_COMPONENT(_mlang ${_absFile} NAME_WE)
IF(APPLE)
INSTALL(FILES ${_current_wx_mofile} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/OpenCPN.app/Contents/Resources/${_mlang}.lproj RENAME wxstd.mo )
INSTALL(FILES ${_current_wx_mofile} DESTINATION
${CMAKE_INSTALL_PREFIX}/bin/OpenCPN.app/Contents/Resources/${_mlang}.lproj
RENAME wxstd.mo
)
ELSE(APPLE)
INSTALL(FILES ${_current_wx_mofile} DESTINATION ${PREFIX_DATA}/locale/${_mlang}/LC_MESSAGES RENAME wxstd.mo PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${_current_wx_mofile} DESTINATION
${PREFIX_DATA}/locale/${_mlang}/LC_MESSAGES
RENAME wxstd.mo
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
ENDIF(APPLE)
ENDFOREACH (_current_wx_mofile )
......@@ -2210,19 +2588,37 @@ IF(WIN32 AND NOT UNIX)
ENDIF(BUNDLE_VCDLLS)
OPTION (BUNDLE_LIBARCHIVEDLLS "Bundle the prebuilt LibArchive and LibLZMA DLLs" ON)
IF(BUNDLE_LIBARCHIVEDLLS)
FILE(GLOB libarchivedll_files "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/archive.dll" "${CMAKE_CURRENT_SOURCE_DIR}/buildwin/liblzma.dll")
FILE(GLOB libarchivedll_files
"${CMAKE_CURRENT_SOURCE_DIR}/buildwin/archive.dll"
"${CMAKE_CURRENT_SOURCE_DIR}/buildwin/liblzma.dll"
"${CMAKE_CURRENT_SOURCE_DIR}/buildwin/zlib1.dll"
)
INSTALL(FILES ${libarchivedll_files} DESTINATION ".")
MESSAGE(STATUS "LibArchive DLLs bundled into the installer package...")
ENDIF(BUNDLE_LIBARCHIVEDLLS)
ENDIF(WIN32 AND NOT UNIX)
IF(MSVC AND OCPN_USE_CRASHREPORT)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/CrashRpt1403.dll DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/CrashSender1403.exe DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/crashrpt_lang.ini DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/dbghelp.dll DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/PrivacyPolicy.txt DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/ocpn_gltest1.exe DESTINATION ${PREFIX_PKGDATA} PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/CrashRpt1403.dll
DESTINATION ${PREFIX_PKGDATA}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/CrashSender1403.exe
DESTINATION ${PREFIX_PKGDATA}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/crashrpt_lang.ini
DESTINATION ${PREFIX_PKGDATA}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/dbghelp.dll
DESTINATION ${PREFIX_PKGDATA}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/buildwin/crashrpt/PrivacyPolicy.txt
DESTINATION ${PREFIX_PKGDATA}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
MESSAGE(STATUS "CrashRpt bundled into the installer package...")
ENDIF(MSVC AND OCPN_USE_CRASHREPORT)
......@@ -2230,7 +2626,7 @@ MESSAGE (STATUS "")
IF(NOT SKIP_PLUGINS)
add_subdirectory (plugins)
ENDIF(NOT SKIP_PLUGINS)
ENDIF ()
# build a CPack driven installer package
#include (InstallRequiredSystemLibraries)
......@@ -2240,7 +2636,7 @@ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenCPN ${PACKAGE_VERSION}")
SET(CPACK_PACKAGE_VERSION ${PACKAGE_VERSION})
SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}${VERSION_TAIL})
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${PACKAGE_NAME};ALL;/")
SET(CPACK_PACKAGE_EXECUTABLES ${PACKAGE_NAME} "OpenCPN")
......@@ -2256,11 +2652,13 @@ IF(WIN32 AND NOT UNIX)
SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_NAME} ${PACKAGE_VERSION}")
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/src/bitmaps\\\\opencpn.ico")
SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}_setup" )
SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_TAIL}_setup" )
SET(CPACK_NSIS_DIR "${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode") #Gunther
SET(CPACK_BUILDWIN_DIR "${CMAKE_SOURCE_DIR}/buildwin") #Gunther
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/data/license.txt")
IF(MINGW)
SET(CPACK_STRIP_FILES "bin/opencpn")
ENDIF(MINGW)
......@@ -2270,19 +2668,15 @@ ELSE(WIN32 AND NOT UNIX)
SET(CPACK_STRIP_FILES "bin/opencpn")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${PACKAGE_VERSION}-${PACKAGE_RELEASE}_${ARCH}" )
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/data/license.html")
ENDIF(WIN32 AND NOT UNIX)
#SET(CPACK_PACKAGE_EXECUTABLES ${PACKAGE_NAME})
#SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${PACKAGE_NAME} ${PACKAGE_VERSION}")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/data/license.txt")
#SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/data/README")
#SET(CPACK_RESOURCE_FILE_WELCOME "${CMAKE_CURRENT_SOURCE_DIR}/data/Welcome.txt")
IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/README")
# MESSAGE(STATUS "Using generic cpack package description file.")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README")
ENDIF ()
SET(CPACK_SOURCE_GENERATOR "TGZ")
# The following components are regex's to match anywhere (unless anchored)
......@@ -2295,22 +2689,6 @@ set(CPACK_SOURCE_IGNORE_FILES
"^${CPACK_PACKAGE_INSTALL_DIRECTORY}/*"
)
IF(APPLE)
# SET(CPACK_GENERATOR "Bundle")
# SET(CPACK_PACKAGE_FILE_NAME "${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
# SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/buildosx/opencpn.icns")
# SET(CPACK_BUNDLE_NAME "${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" )
# SET(CPACK_BUNDLE_ICON "${CMAKE_SOURCE_DIR}/buildosx/opencpn.icns")
# SET(CPACK_BUNDLE_PLIST "${CMAKE_SOURCE_DIR}/buildosx/Info.plist")
# SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/buildosx/README.txt")
# SET(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/buildosx/README.txt")
# SET(CPACK_PACKAGING_INSTALL_PREFIX "/")
ENDIF(APPLE)
IF(UNIX AND NOT APPLE)
# INCLUDE(UseRPMTools)
# IF(RPMTools_FOUND)
......@@ -2320,7 +2698,10 @@ IF(UNIX AND NOT APPLE)
SET(CPACK_STRIP_FILES ON)
SET(CPACK_GENERATOR ${PACKAGE_FORMAT})
SET(CPACK_PACKAGE_CONTACT "David S. Register ")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS ${PACKAGE_DEPS})
# autogenerate additional dependency information
SET (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS ${PACKAGE_RECS})
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${ARCH})
SET(CPACK_DEBIAN_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
......@@ -2345,41 +2726,46 @@ ENDIF(UNIX AND NOT APPLE)
IF(WIN32 AND NOT UNIX)
IF(NOT SKIP_VERSION_CONFIG)
configure_file(${CMAKE_SOURCE_DIR}/src/opencpn.rc.in ${CMAKE_SOURCE_DIR}/src/opencpn.rc)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_GERMAN.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_GERMAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_FRENCH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_FRENCH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_CZECH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_CZECH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_DANISH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_DANISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_SPANISH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_SPANISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_ITALIAN.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_ITALIAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_DUTCH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_DUTCH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_POLISH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_POLISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_PORTUGUESEBR.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_PORTUGUESEBR.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_PORTUGUESE.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_PORTUGUESE.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_RUSSIAN.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_RUSSIAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_SWEDISH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_SWEDISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_FINNISH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_FINNISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_NORWEGIAN.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_NORWEGIAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_CHINESETW.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_CHINESETW.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_TURKISH.nsh.in" "${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_TURKISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_GERMAN.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_GERMAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_FRENCH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_FRENCH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_CZECH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_CZECH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_DANISH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_DANISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_SPANISH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_SPANISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_ITALIAN.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_ITALIAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_DUTCH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_DUTCH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_POLISH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_POLISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_PORTUGUESEBR.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_PORTUGUESEBR.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_PORTUGUESE.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_PORTUGUESE.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_RUSSIAN.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_RUSSIAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_SWEDISH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_SWEDISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_FINNISH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_FINNISH.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_NORWEGIAN.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_NORWEGIAN.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_CHINESETW.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_CHINESETW.nsh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/buildwin/NSIS_Unicode/Language files/Langstrings_TURKISH.nsh.in"
"${CMAKE_SOURCE_DIR}//buildwin/NSIS_Unicode/Include/Langstrings_TURKISH.nsh" @ONLY)
ENDIF(NOT SKIP_VERSION_CONFIG)
ENDIF(WIN32 AND NOT UNIX)
#IF(NOT SKIP_VERSION_CONFIG)
# configure_file(version.h.in ${CMAKE_SOURCE_DIR}/include/version.h)
#ENDIF(NOT SKIP_VERSION_CONFIG)
# Do the version.h configuration into the build output directory,
# thereby allowing building from a read-only source tree.
IF(NOT SKIP_VERSION_CONFIG)
configure_file(version.h.in ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include/version.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/include)
ENDIF(NOT SKIP_VERSION_CONFIG)
# this dummy target is necessary to make sure the ADDITIONAL_MAKE_CLEAN_FILES directive is executed.
# apparently, the base CMakeLists.txt file must have "some" target to activate all the clean steps.
ADD_CUSTOM_TARGET(dummy COMMENT "dummy: Done." DEPENDS ${PACKAGE_NAME})
SET_DIRECTORY_PROPERTIES(dummy ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_SOURCE_DIR}/include/version.h)
SET_DIRECTORY_PROPERTIES(dummy ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_SOURCE_DIR}/include/config.h)
INCLUDE(CPack)
......@@ -2404,17 +2790,27 @@ IF(APPLE)
INSTALL(CODE "
include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"${LIBS}\" \"${DIRS}\")
" COMPONENT Runtime)
" COMPONENT Runtime
)
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.dmg
COMMAND ${CMAKE_SOURCE_DIR}/buildosx/create-dmg --volname "OpenCPN Installer" --background ${CMAKE_SOURCE_DIR}/buildosx/background.png --window-pos 200 120 --window-size 500 300 --icon-size 80 --icon OpenCPN.app 120 150 --hide-extension OpenCPN.app --app-drop-link 390 145 ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.dmg ${CMAKE_INSTALL_PREFIX}/bin/
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_TAIL}.dmg
COMMAND ${CMAKE_SOURCE_DIR}/buildosx/create-dmg --volname "OpenCPN Installer" --background ${CMAKE_SOURCE_DIR}/buildosx/background.png --window-pos 200 120 --window-size 500 300 --icon-size 80 --icon OpenCPN.app 120 150 --hide-extension OpenCPN.app --app-drop-link 390 145 ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_TAIL}.dmg ${CMAKE_INSTALL_PREFIX}/bin/
DEPENDS ${CMAKE_INSTALL_PREFIX}/bin/OpenCPN.app
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "create-dmg [${PACKAGE_NAME}]: Generated dmg file."
)
ADD_CUSTOM_TARGET(create-dmg COMMENT "create-dmg: Done." DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.dmg)
ADD_CUSTOM_TARGET(create-dmg COMMENT "create-dmg: Done." DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}${VERSION_TAIL}.dmg
)
ENDIF(APPLE)
IF(MSVC)
ADD_CUSTOM_COMMAND(TARGET ${PACKAGE_NAME}
POST_BUILD
COMMAND cmake -E copy "${CMAKE_BUILD_TYPE}/opencpn.pdb" "${CMAKE_BUILD_TYPE}/${PACKAGE_NAME}-${PACKAGE_VERSION}.pdb")
ENDIF(MSVC)
MESSAGE(STATUS "Writing spec file...")
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
This diff is collapsed.
This diff is collapsed.
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
#
# - Try to find libsndfile
# Once done, this will define
#
# LIBSNDFILE_FOUND - system has libsndfile
# LIBSNDFILE_INCLUDE_DIRS - the libsndfile include directories
# LIBSNDFILE_LIBRARIES - link these to use libsndfile
#
# Copied from:
# https://github.com/neXyon/audaspace/blob/master/cmake/FindLibSndFile.cmake
#
# Copyright (c) 2009-2015 Jörg Müller. All rights reserved.
# License: Apache 2.0 (not distributed in binary packages).
# Use pkg-config to get hints about paths
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(LIBSNDFILE_PKGCONF sndfile)
endif(PKG_CONFIG_FOUND)
# Include dir
find_path(LIBSNDFILE_INCLUDE_DIR
NAMES sndfile.h
PATHS ${LIBSNDFILE_PKGCONF_INCLUDE_DIRS}
)
# Library
find_library(LIBSNDFILE_LIBRARY
NAMES sndfile libsndfile-1
PATHS ${LIBSNDFILE_PKGCONF_LIBRARY_DIRS}
)
find_package(PackageHandleStandardArgs)
find_package_handle_standard_args(LibSndFile DEFAULT_MSG LIBSNDFILE_LIBRARY LIBSNDFILE_INCLUDE_DIR)
if(LIBSNDFILE_FOUND)
set(LIBSNDFILE_LIBRARIES ${LIBSNDFILE_LIBRARY})
set(LIBSNDFILE_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR})
endif(LIBSNDFILE_FOUND)
mark_as_advanced(LIBSNDFILE_LIBRARY LIBSNDFILE_LIBRARIES LIBSNDFILE_INCLUDE_DIR LIBSNDFILE_INCLUDE_DIRS)
......@@ -89,44 +89,8 @@ starting configuration.
6. Serial Port GPS/AIS Data Input and Autopilot Output
----------------------------------------------------------------------
a. LINUX
Opencpn runs at user privilege. This means that in order to
read GPS input data and/or write autopilot output data, the serial
devices to be used must exhibit read and write permission for the
user in question. For linux, these devices are created at startup.
Typically, the devices as created are owned by root, with additional
specific group (e.g. "uucp") r/w access, i.e. permissions are 0660.
This configuration WILL NOT WORK for OpenCPN unless the user happens
to belong to the group under which the devices were created,
typically "uucp". Not likely...
For the more general case, you must ensure that device permissions
will enable opencpn to read and write serial devices without root
privileges. There are several ways to do this.
On a Linux with udev, check the files in /etc/udev/rules.d to
ensure that /dev/tty* devices are all created with the same group
and with 0666 permissions. More generally, you may need to run mknod
or MAKEDEV as root to create a properly permissioned serial device before
executing opencpn. For example:
linux# mknod -m 666 /dev/ttyS0 c 4 64
If you use USB serial port adapters and your system has the Linux
hotplug facility installed, Todo............
Test your GPS input. At user privilege,
linux$ stty -F /dev/ttyXXX ispeed 4800
linux$ cat </dev/ttyXXX
replace ttyXXX with the filename of the port. This will probably be
either /dev/ttyUSB0 or /dev/ttyS0. When you run this command, you
should see text lines beginning with $ come to stdout (possibly after
a short initial burst of binary garbage). If you don't see this, you
may have OS-level problems with your serial support, but more likely
have the wrong device or permissions. Look again.
See the file LINUX_DEVICESS.md in the distribution or at
https://github.com/OpenCPN/OpenCPN/blob/master/LINUX_DEVICES.md
---------------------------------------------------------------------
7. Cross Compiling for windows using mingw
......
Files developed in this project are copyright (c) The OpenCPN
developers and distributed using a GPPLv2+ license; you can
find the terms in the file COPYING.gplv2
OpenCPN also uses code from other sources with other licenses
including:
- GPL (v3 or later) - see COPYING.gplv3
- LGPL (v3 or later) - see COPYING.lgplv3
- LGPL (v2 or later) - see COPYING.lgplv2
- BSD (2 clause)
- BSD (3 clause)
- MIT/X11 (BSD like)
- zlib/libpng
- CC0
- SGI Free Software License B (v1.1)
- SGI Free Software License B (v2.0)
- SGI Free Software License B
- Apache (v2.0)
- Creative Commons 0 License
The complete file-by-file list is available in the file data/copyright.
OpenCPN devices under Linux
---------------------------
Opencpn runs at user privilege. This means that in order to
read GPS input data and/or write autopilot output data, the serial
devices to be used must exhibit read and write permission for the
user in question.
Furthermore, typical device names like */dev/ttyUSB0* or */dev/ttyACM0*
are not stable over a suspend cycle. A device might change name to
*/dev/ttyUSB1* when the laptop lid is opened after being closed.
These aspects, permissions and dynamic names, is about udev which handles
the devices in all modern Linux distros.
## Device access.
Most distros have serial device access restricted to root or users in a
specific group. To check, list e. g. the /dev/ttyS0 device:
$ ls -l /dev/ttyS0
crw-rw---- 1 root dialout 4, 64 Jul 17 09:42 /dev/ttyS0
Here, the device is owned by root but can also be accessed by any user in
the dialout group. To get access to this device, add your user to the
group owner of the device, something like
$ sudo usermod -aG dialout $USER
and logout and in again (or reboot). Test the permissions using
$ stty -F /dev/ttyXXX ispeed 4800
which gives an error message if it doesn't work.
If the group permissions doesn't make the trick, a udev rule could be used
instead to give all users read/write access to the device. Create a file
called */etc/udev/rules.d/70-serial-opencpn.rules* like
KERNEL=="ttyUSB*", MODE="0666"
KERNEL=="ttyACM*", MODE="0666"
KERNEL=="ttyS*", MODE="0666"
A reboot might be needed for it to take effect. Normally, just one of the
three lines is required depending on device used, the rest could be removed.
Test the permissions (above).
_flatpak_ users need to install the udev rule, the group permissions can
not be used from the flatpaked opencpn.
## Fixed device names
If your device disappears after closing and opening the laptop lid you need
to arrange for a fixed device name. This is done with a udev rule. My rule
is named */etc/udev/rules.d/50-nmea.rules* and looks like:
$ cat /etc/udev/rules.d/50-nmea.rules
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", ACTION=="add",SYMLINK+="nmea"
which basically tells udev that any device from vendor 067b with product
id 2303 should have an additional device name */dev/nmea*, which is the
name used in opencpn. This name will always be the same.
The vendor and product id could be retrieved using lsusb:
$ lsusb
...
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 056a:033c Wacom Co., Ltd
Bus 003 Device 002: ID 046d:c03d Logitech, Inc. M-BT96a Pilot Optical Mouse
which for example shows that the mouse has vendor 046d and product id c03d.
Another way is to use udevadm. It creates a lot of output, so do something
like:
$ udevadm info attribute-walk /dev/ttyUSB0 > walk.log
$ grep idProduct walk.log
ATTRS{idProduct}=="0938"
$ grep idVendor walk.log
ATTRS{idVendor}=="1781"
Udev rules is a large topic; please refer to more general info for more.
## Testing
Test the port like:
$ stty -F /dev/ttyXXX ispeed 4800
$ cat </dev/ttyXXX
replacing ttyXXX with the filename of the port. This will probably be
either /dev/ttyUSB0 or /dev/ttyS0. When you run this command, you
should see text lines like:
$GPGGA,092750.000,5321.6802,N,00630.3372,W,1,8,1.03,61.7,M,55.2,M,,*76
$GPGSA,A,3,10,07,05,02,29,04,08,13,,,,,1.72,1.03,1.38*0A
$GPGSV,3,1,11,10,63,137,17,07,61,098,15,05,59,290,20,08,54,157,30*70
$GPGSV,3,2,11,02,39,223,19,13,28,070,17,26,23,252,,04,14,186,14*79
If you don't see this, you may have OS-level problems with your serial
support, but more likely have the wrong device or permissions. Look again.
......@@ -707,9 +707,9 @@ CMake variables
Section "-Topmost Section" SecTopmost ;# this needs to be always the first section to be executed!
SetShellVarContext all
SetOutPath $INSTDIR
!ifndef NSIS_PACKEDVERSION
LogSet on
!endif
;!ifndef NSIS_PACKEDVERSION
; LogSet on
;!endif
${If} $INSTALL_TYPE == 1
${OrIf} $INSTALL_TYPE == 2
${OrIf} $INSTALL_TYPE == 3
......
......@@ -30,3 +30,5 @@ a. Opencpn was built with the following objectives in mind.
Our thanks go to MAXCDN for providing a CDN network delivering
the OpenCPN downloads worldwide.
OpenCPN is distributed using a multitude of licenses, see LICENSING.
SET(VERSION_MAJOR "4")
SET(VERSION_MINOR "8")
SET(VERSION_PATCH "8")
SET(VERSION_DATE "2018-11-06")
SET(VERSION_MAJOR "5")
SET(VERSION_MINOR "0")
SET(VERSION_PATCH "0")
SET(VERSION_DATE "2019-03-22")
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True/PM</dpiAware>
</windowsSettings>
</application>
</assembly>
clone_folder: c:\project\opencpn
shallow_clone: true
shallow_clone: false
clone_depth: 10
image:
- Visual Studio 2015
- Visual Studio 2017
platform:
# - x64
......@@ -11,40 +13,42 @@ configuration: Release
test: OFF
install:
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86'
# VS2015 and earlier version - '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86'
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
# sent environment variables for wxWidgets
- set WXWIN=C:\wxWidgets-3.0.2
# set environment variables for wxWidgets
- set WXWIN=C:\wxWidgets-3.1.2
- set wxWidgets_ROOT_DIR=%WXWIN%
- set wxWidgets_LIB_DIR=%WXWIN%\lib\vc_dll
- cmd: SET PATH=%PATH%;%WXWIN%;%wxWidgets_LIB_DIR%;C:\Program Files (x86)\Poedit\Gettexttools\bin;
# install dependencies:
- choco install poedit -x86
- choco install poedit
- ps: Start-FileDownload http://opencpn.navnux.org/build_deps/nsis-3.03-setup.exe
- cmd: nsis-3.03-setup.exe /S
# - choco install nsi -x86
- ps: Start-FileDownload http://opencpn.navnux.org/build_deps/nsis-3.04-setup.exe
- cmd: nsis-3.04-setup.exe /S
# Download and unzip wxwidgets
- ps: Start-FileDownload http://downloads.sourceforge.net/project/wxwindows/3.0.2/wxWidgets-3.0.2.zip
- cmd: 7z x wxwidgets-3.0.2.zip -o%WXWIN% > null
- ps: Start-FileDownload http://opencpn.navnux.org/build_deps/wxWidgets-3.1.2.7z
- cmd: 7z x wxWidgets-3.1.2.7z -o%WXWIN% > null
# some debugging information
- set
# - cmake --help
# build wxWidgets
- cmd: cd %WXWIN%\build\msw\
- cmd: nmake -f makefile.vc BUILD=release SHARED=1 CFLAGS=/D_USING_V120_SDK71_ CXXFLAGS=/D_USING_V120_SDK71_
- cmd: nmake -f makefile.vc BUILD=debug SHARED=1 CFLAGS=/D_USING_V120_SDK71_ CXXFLAGS=/D_USING_V120_SDK71_
# build wxWidgets - Disabled as we provide prebuilt WX to save time
#- cmd: cd %WXWIN%\build\msw\
#- cmd: nmake -f makefile.vc BUILD=release SHARED=1 CFLAGS=/D_USING_V120_SDK71_ CXXFLAGS=/D_USING_V120_SDK71_
#- cmd: nmake -f makefile.vc BUILD=debug SHARED=1 CFLAGS=/D_USING_V120_SDK71_ CXXFLAGS=/D_USING_V120_SDK71_
before_build:
- cd c:\project\opencpn
- mkdir build
- cd build
- ps: Start-FileDownload http://downloads.sourceforge.net/project/opencpnplugins/opencpn_packaging_data/OpenCPN_buildwin.7z
- cmd: 7z x -y OpenCPN_buildwin.7z -oc:\project\opencpn
- cmake -T v120_xp ..
- ps: Start-FileDownload http://opencpn.navnux.org/build_deps/OpenCPN_buildwin-4.99a.7z
- cmd: 7z x -y OpenCPN_buildwin-4.99a.7z -oc:\project\opencpn\buildwin
- cmake -T v141_xp -DOCPN_CI_BUILD=ON ..
build_script:
# - cmake --build . --config debug
......@@ -59,6 +63,9 @@ artifacts:
- path: 'build\Release\opencpn.lib'
name: lib
- path: 'build\Release\opencpn-*.pdb'
name: pdb
deploy:
description: 'release created by AppVeyor CI'
provider: GitHub
......
Source: opencpn
Build-Depends: debhelper (>= 9),
cmake,
libarchive-dev,
libbz2-dev,
libcairo2-dev,
libcurl4-openssl-dev,
libelf-dev,
libexif-dev,
libgdk-pixbuf2.0-dev,
libgtk2.0-dev,
liblz4-dev,
liblzma-dev,
libpango1.0-dev,
libsqlite3-dev,
libtinyxml-dev,
libunarr-dev | base-files,
libwxgtk3.0-dev,
libwxgtk3.0-0v5 | libwxgtk3.0-0,
libwxsvg-dev | base-files,
portaudio19-dev
Standards-Version: 4.3.0
Homepage: https://opencpn.org
Description: Packages needed to build opencpn on debian.
The Build-Depends field can be used to install dependencies
using mk-build-deps.
.
These packages are available in trusty+.
Source: opencpn
Build-Depends: debhelper (>= 9),
cmake,
libarchive-dev,
libbz2-dev,
libcairo2-dev,
libcurl4-openssl-dev,
libelf-dev,
libexif-dev,
libgdk-pixbuf2.0-dev,
libgtk2.0-dev,
liblz4-dev,
liblzma-dev,
libpango1.0-dev,
libsqlite3-dev,
libtinyxml-dev,
libunarr-dev | base-files,
libwxgtk3.0-dev,
libwxgtk3.0-0v5 | libwxgtk3.0-0,
libwxgtk-webview3.0-0v5 | libwxgtk3.0-libwxgtk3.0-0,
libwxgtk-webview3.0-dev | libwxgtk3.0-dev,
libwxsvg-dev | base-files,
portaudio19-dev
Standards-Version: 4.3.0
Homepage: https://opencpn.org
Description: Packages needed to build opencpn on debian.
The Build-Depends field can be used to install dependencies
using mk-build-deps.
.
These packages are available in trusty+.
#!/usr/bin/env bash
#
# Build the Travis Debian artifacts
#
set -xe
sudo apt-get -qq update
sudo apt-get install devscripts equivs
mkdir build
cd build
ln -s ../ci/control.${OCPN_TARGET} ../ci/control
mk-build-deps ../ci/control
sudo apt-get install ./*all.deb || :
sudo apt-get --allow-unauthenticated install -f
cmake -DCMAKE_BUILD_TYPE=Debug ..
make -sj2
make package
#!/usr/bin/env bash
#
# Build the Travis OSX artifacts
#
# bailout on errors and echo commands
set -xe
brew install cairo libexif xz libarchive
wget http://opencpn.navnux.org/build_deps/wx312_opencpn50_macos109.tar.xz
tar xJf wx312_opencpn50_macos109.tar.xz -C /tmp
export PATH="/usr/local/opt/gettext/bin:$PATH"
echo 'export PATH="/usr/local/opt/gettext/bin:$PATH"' >> ~/.bash_profile
mkdir build
cd build
test -n "$TRAVIS_TAG" && CI_BUILD=OFF || CI_BUILD=ON
cmake -DOCPN_CI_BUILD=$CI_BUILD \
-DOCPN_USE_LIBCPP=ON \
-DwxWidgets_CONFIG_EXECUTABLE=/tmp/wx312_opencpn50_macos109/bin/wx-config \
-DwxWidgets_CONFIG_OPTIONS="--prefix=/tmp/wx312_opencpn50_macos109" \
-DCMAKE_INSTALL_PREFIX=/tmp/opencpn -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
..
make -sj2
mkdir -p /tmp/opencpn/bin/OpenCPN.app/Contents/MacOS
mkdir -p /tmp/opencpn/bin/OpenCPN.app/Contents/SharedSupport/plugins
chmod 644 /usr/local/lib/lib*.dylib
make install
make install # Dunno why the second is needed but it is, otherwise
# plugin data is not included in the bundle
make create-dmg