GenericMappingTools / GenericMappingTools/gmt

Document how to add new custom supplements for third-party developers

Open
#3,127 10 comments 0 reactions 0 assignees View on GitHub
discussion documentation
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

For any developers who want to develop custom supplements, they need to have a src subdirectory, some C codes, and most importantly, a CMakeLists.txt file.

Here is a full list of all CMake settings that can be included in the CMakeLists.txt:
```
# SUPPL_NAME [required]
# name of the supplement package. It can be different from the directory name.
set (SUPPL_NAME newsuppl1)

# SUPPL_PROGS_SRCS [required]
# list of C source codes for supplemental modules
set (SUPPL_PROGS_SRCS psmeca.c pspolar.c pscoupe.c pssac.c)

# SUPPL_LIB_SRCS [required]
# list of C source codes for supplemental library
set (SUPPL_LIB_SRCS ${SUPPL_PROGS_SRCS} utilmeca.c sacio.c)

# SUPPL_HEADERS [optional]
# header files. Will be installed if BUILD_DEVELOPER is TRUE
set (SUPPL_HEADERS meca.h utilmeca.h sacio.h)

# SUPPL_EXAMPLE_FILES [optional]
# README and other example files
set (SUPPL_EXAMPLE_FILES README.seis)

# SUPPL_EXAMPLE_PROGS [optional]
# example scripts
set (SUPPL_EXAMPLE_PROGS test1.sh test2.sh)

# SUPPL_EXTRA_INCLUDES [optional]
# list of extra include directories
set (SUPPL_EXTRA_INCLUDES /usr/local/xxx1/include /usr/local/xxx2/include)

# SUPPL_EXTRA_LIBRARIES [optional]
# list of extra libraries to link. Can be absolute paths or library names
set (SUPPL_EXTRA_LIBS /usr/local/xxx1/lib/libxxx1.so xxx2)

# SUPPL_LIB_NAME [optional]
# name of the supplement library.
# If not set, the supplement package will be built into GMT's supplements.so.
set (SUPPL_LIB_NAME newsuppl1)

# SUPPL_DLL_RENAME [optional, Windows only]
# rename the supplement library on Windows
set (SUPPL_DLL_RENAME "newsuppl1_w32")
```

We need to document it somewhere. Maybe in the cmake/ConfigUserAdvanced.cmake or a standalone file listed in the the "Developer Resources" of the GMT documentation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.