Skip to content

WIP: Fix GSHHGDIR and DCWDIR #984

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions share/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ if (GSHHG_PATH AND COPY_GSHHG)
DESTINATION ${GMT_DATADIR}/coast
COMPONENT GSHHG)
# location must be blank in gmt.conf
set (GSHHG_INSTALL_PATH)
set (GSHHG_INSTALL_PATH CACHE INTERNAL "Location of GSHHG Data")
# create coastline.conf which is needed for in-build-dir ctest
configure_file (coastline.conf.in coastline.conf @ONLY)
else (GSHHG_PATH AND COPY_GSHHG)
# set installed location
set (GSHHG_INSTALL_PATH ${GSHHG_PATH})
set (GSHHG_INSTALL_PATH ${GSHHG_PATH} CACHE INTERNAL "Location of GSHHG Data")
endif (GSHHG_PATH AND COPY_GSHHG)

# only attempt to install DCW file when requested and path is known
Expand All @@ -48,10 +48,10 @@ if (DCW_PATH AND COPY_DCW)
DESTINATION ${GMT_DATADIR}/dcw
COMPONENT DCW)
# location must be blank in gmt.conf
set (DCW_INSTALL_PATH)
set (DCW_INSTALL_PATH CACHE INTERNAL "Location of DCW Data")
else (DCW_PATH AND COPY_DCW)
# set installed location
set (DCW_INSTALL_PATH ${DCW_PATH})
set (DCW_INSTALL_PATH ${DCW_PATH} CACHE INTERNAL "Location of GSHHG Data")
endif (DCW_PATH AND COPY_DCW)


Expand Down
4 changes: 2 additions & 2 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
#define PSL_LIB_NAME "@PSL_LIB_NAME@"

/* Name of DCW path */
#define DCW_INSTALL_PATH "@DCW_PATH@"
#define DCW_INSTALL_PATH "@DCW_INSTALL_PATH@"

/* Name of GSHHG path */
#define GSHHG_INSTALL_PATH "@GSHHG_PATH@"
#define GSHHG_INSTALL_PATH "@GSHHG_INSTALL_PATH@"

/* Default units (SI vs US) */
#define GMT_DEF_UNITS "@UNITS@"
Expand Down
6 changes: 4 additions & 2 deletions src/gmt_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -5599,11 +5599,13 @@ void gmtinit_conf (struct GMT_CTRL *GMT) {
/* DIR_DCW */
if (GMT->session.DCWDIR)
gmt_M_str_free (GMT->session.DCWDIR);
GMT->session.DCWDIR = strdup (DCW_INSTALL_PATH);
if (strlen(DCW_INSTALL_PATH))
GMT->session.DCWDIR = strdup (DCW_INSTALL_PATH);
/* DIR_GSHHG */
if (GMT->session.GSHHGDIR)
gmt_M_str_free (GMT->session.GSHHGDIR);
GMT->session.GSHHGDIR = strdup (GSHHG_INSTALL_PATH);
if (strlen(GSHHG_INSTALL_PATH))
GMT->session.GSHHGDIR = strdup (GSHHG_INSTALL_PATH);

/* TIME group */

Expand Down