Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Security

## [5.26.0] - 2026-11-10

### Added

- Added `DetermineOS.cmake` and `OS.rc.in` files to record OS details at build time

## [5.25.0] - 2026-11-06

### Changed
Expand Down
1 change: 1 addition & 0 deletions esma.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ else()
endif()

include(DetermineSite)
include(DetermineOS)
find_package(GitInfo)
if (MPI_FOUND)
include(DetermineMPIStack)
Expand Down
26 changes: 26 additions & 0 deletions external_libraries/DetermineOS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
##### OS Detection #####

# At NAS, there are two OSs: TOSS4 and TOSS5. As such, if you build on TOSS5, you
# must submit from TOSS5 to TOSS5 compute nodes (and vice versa). So we need to
# detect the OS and make a file like SITE.rc

if(LINUX)
cmake_host_system_information(RESULT os_id QUERY DISTRIB_ID)
cmake_host_system_information(RESULT os_version QUERY DISTRIB_VERSION_ID)
cmake_host_system_information(RESULT os_name QUERY DISTRIB_PRETTY_NAME)
elseif(APPLE)
# cmake_host_system_information for distrib_id does not work on macOS
cmake_host_system_information(RESULT os_id QUERY OS_NAME)
cmake_host_system_information(RESULT os_version QUERY OS_RELEASE)
cmake_host_system_information(RESULT os_name QUERY OS_NAME)
endif()

set(GEOS_OS_ID ${os_id} CACHE STRING "Detected OS ID for use with GEOS setup scripts")
set(GEOS_OS_VERSION ${os_version} CACHE STRING "Detected OS version for use with GEOS setup scripts")
set(GEOS_OS_NAME ${os_name} CACHE STRING "Detected OS name for use with GEOS setup scripts")
message(STATUS "Setting GEOS_OS_ID to ${GEOS_OS_ID}")
message(STATUS "Setting GEOS_OS_VERSION to ${GEOS_OS_VERSION}")
message(STATUS "Setting GEOS_OS_NAME to ${GEOS_OS_NAME}")

configure_file(${CMAKE_CURRENT_LIST_DIR}/OS.rc.in ${CMAKE_CURRENT_BINARY_DIR}/OS.rc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/OS.rc DESTINATION etc)
3 changes: 3 additions & 0 deletions external_libraries/OS.rc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
OS_ID: @GEOS_OS_ID@
OS_VERSION: @GEOS_OS_VERSION@
OS_NAME: @GEOS_OS_NAME@
Loading