Skip to content

Commit

Permalink
Set phy_VERSION and dyn_VERSION variables with versions found in the …
Browse files Browse the repository at this point in the history
…MANIFEST of each library
  • Loading branch information
chantal-pic committed Jan 9, 2024
1 parent a987113 commit ad85458
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ gem_dbase
gem_dbase.tar.gz
/build*
/work*
src/gemdyn/include/gemdyn_version.inc
src/gemdyn/src/main/main*.F90
src/gemdyn/src/no_mpi/maingem_monitor_end.c
src/gemdyn/src/no_mpi/maingem_monitor_output.c
Expand Down
7 changes: 6 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,14 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/src/rpnphy/CMakeLists.txt)
set(cpl_LIBRARIES rpnphy_cpl_stubs CACHE STRING "rpnphy coupling library")
set(chm_LIBRARIES rpnphy_chm_stubs CACHE STRING "rpnphy chemistry stub library")
add_subdirectory(rpnphy rpnphy)
set(phy_VERSION ${rpnphy_VERSION} CACHE STRING "rpnphy version")
endif()

if (EXISTS ${CMAKE_SOURCE_DIR}/src/gemdyn/CMakeLists.txt)
add_subdirectory(gemdyn gemdyn)
set(dyn_VERSION ${gemdyn_VERSION} CACHE STRING "gemdyn version")
endif()

add_subdirectory(gemdyn gemdyn)
add_subdirectory(gem gem)

# Add those tools only for external users, or if WITH_SYSTEM_RPN is FALSE
Expand Down
6 changes: 6 additions & 0 deletions src/gem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ endif()

add_executable(maingemdm maingemdm.F90)

target_compile_definitions(maingemdm PUBLIC
dyn_VERSION="${dyn_VERSION}"
modelutils_VERSION="${modelutils_VERSION}"
phy_VERSION="${phy_VERSION}"
)

target_link_libraries(maingemdm
gemdyn
${phy_LIBRARIES}
Expand Down
9 changes: 3 additions & 6 deletions src/gem/maingemdm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ program gem
implicit none

#include <gem_build_info.h>
#include <gemdyn_version.inc>
#include <rpnphy_version.inc>
#include <modelutils_version.inc>

integer(kind=int32) ierror

app_ptr=app_init(0,PROJECT_NAME_STRING,VERSION,PROJECT_DESCRIPTION_STRING,BUILD_TIMESTAMP)
call app_libregister(APP_LIBVGRID,HAVE_VGRID)
call app_libregister(APP_LIBTDPACK,HAVE_TDPACK)
call app_libregister(APP_LIBGEMDYN,GEMDYN_VERSION_S)
call app_libregister(APP_LIBRPNPHY,RPNPHY_VERSION_S)
call app_libregister(APP_LIBMDLUTIL,MODELUTILS_VERSION_S)
call app_libregister(APP_LIBDYN,dyn_VERSION)
call app_libregister(APP_LIBPHY,phy_VERSION)
call app_libregister(APP_LIBMDLUTIL,modelutils_VERSION)

call MPI_INIT(ierror)
call app_start()
Expand Down

0 comments on commit ad85458

Please sign in to comment.