Skip to content

Commit

Permalink
add build_extra cmake option and update extra/CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA committed Oct 16, 2024
1 parent 5d21e96 commit 95e9da9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ set(BUILD_COMMENTS "stock build")
option(BUILD_LIB "Build wgrib2 library?" on)
option(BUILD_SHARED_LIB "Build shared library?" off)
option(BUILD_WGRIB "Build wgrib code?" off)
option(BUILD_EXTRA "Build user-contributed code" on)

if (MAKE_FTN_API OR USE_IPOLATES)
enable_language(Fortran)
Expand Down Expand Up @@ -140,6 +141,11 @@ message(STATUS "Writing config.h...")
configure_file("${PROJECT_SOURCE_DIR}/wgrib2/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h")
include_directories(${CMAKE_CURRENT_BINARY_DIR})

message(STATUS "Checking if the user wants to use user-contributed code...")
if (BUILD_EXTRA)
add_subdirectory(extra)
endif()

message(STATUS "Adding wgrib2, aux_probs subdirectories...")
add_subdirectory(wgrib2)
add_subdirectory(aux_progs)
Expand Down
6 changes: 5 additions & 1 deletion extra/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
set(extra_src Mysql.c Mysql_dump.c Mysql_speed.c)
set(extra_src Mysql.c Mysql_dump.c Mysql_speed.c)

add_library(extra OBJECT ${extra_src})

install(TARGETS extra RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
1 change: 1 addition & 0 deletions wgrib2/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#cmakedefine BUILD_LIB
#cmakedefine BUILD_SHARED_LIB
#cmakedefine BUILD_WGRIB
#cmakedefine BUILD_EXTRA
#cmakedefine TEST_FILE_DIR "@TEST_FILE_DIR@"

#define BUILD_COMMENTS "@BUILD_COMMENTS@"
Expand Down

0 comments on commit 95e9da9

Please sign in to comment.