Skip to content

Commit

Permalink
Allow new supplement testing (GenericMappingTools#3092)
Browse files Browse the repository at this point in the history
* Allow new supplement testing

Specifically, allow a supplement to have some specific include and library requirements not part of the supplement (e..g, system libs and includes).

* Update CMakeLists.txt

* Update CMakeLists.txt

* Update ConfigUserAdvancedTemplate.cmake
  • Loading branch information
PaulWessel authored Apr 14, 2020
1 parent 41ad69a commit 5f64100
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ cmake/ConfigUser.cmake
cmake/ConfigUserAdvanced.cmake
share/coast
share/dcw
src/newsuppl*
**/gmt.history
.DS_Store
3 changes: 2 additions & 1 deletion cmake/ConfigUserAdvancedTemplate.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,8 @@
# List extra sub-dirs of 'src' with a CMakeList.txt to build non-module codes
# that link against the full gmt libs (not just the API; for building codes
# that only need the GMT API, see the gmt-custom project).
#set (EXTRA_BUILD_DIRS apidemo)
# These supplemental modules end up in supplements.so like the GMT supplements.
#set (EXTRA_BUILD_DIRS newsuppl1 newsuppl2 ...)

# List extra new supplemental modules for testing without adding them to the module list
#set (EXTRA_MODULES_SUPPL newsuppl1.c newsuppl2.c)
Expand Down
12 changes: 10 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,16 @@ if (BUILD_SUPPLEMENTS)
include_directories (${CMAKE_CURRENT_BINARY_DIR}/${_dir})
endforeach (_dir)

# supplement library files
# supplement extra (non-GMT) library files, if any
get_subdir_var_files (GMT_SUPPL_LIB_SRCS SUPPL_LIB_SRCS ${GMT_SUPPL_DIRS})

# supplement extra (non-GMT) include files, if any
get_subdir_var (GMT_EXTRA_INCLUDES SUPPL_EXTRA_INCLUDES ${GMT_SUPPL_DIRS})
include_directories (${GMT_EXTRA_INCLUDES})

# supplement extra library files
get_subdir_var (GMT_EXTRA_LIBRARIES SUPPL_EXTRA_LIBS ${GMT_SUPPL_DIRS})

# libgmtsuppl
if (WIN32)
add_library (supplib
Expand All @@ -703,7 +710,8 @@ if (BUILD_SUPPLEMENTS)
# No SOVERSION & VERSION for a MODULE, only for SHARED libs
target_link_libraries (supplib
gmtlib
pslib)
pslib
${GMT_EXTRA_LIBRARIES})

# Include any extra files that are listed in EXTRA_MODULES_SUPPL defined in ConfigUserAdvanced.cmake
# This include(s) will add new modules to the official GMT supplements
Expand Down

0 comments on commit 5f64100

Please sign in to comment.