Skip to content

Commit

Permalink
fixed python version in cmake (#1374)
Browse files Browse the repository at this point in the history
cmake now detects the python version;
previously hard-coded.
This came up in #1362
  • Loading branch information
givelberg authored Nov 14, 2024
1 parent 1c5cc2e commit 5fb52d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/marine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ install(FILES ${test_input}
# bufr to ioda tests:
###########################################################################

find_package(Python REQUIRED)
# Extract the major and minor version (e.g., "3.10" from "3.10.13")
string(REGEX REPLACE "^([0-9]+\\.[0-9]+).*" "\\1" PYTHON_MAJOR_MINOR ${Python_VERSION})
set(PYIODACONV_DIR "${PROJECT_SOURCE_DIR}/build/lib/python${PYTHON_MAJOR_MINOR}/")

set(TEST_WORKING_DIR ${PROJECT_BINARY_DIR}/test/marine)
set(MARINE_BUFR2IODA_DIR ${PROJECT_SOURCE_DIR}/ush/ioda/bufr2ioda/marine)
set(MARINE_BUFR2IODA_DIR ${MARINE_BUFR2IODA_DIR}/b2i)
set(CONFIG_DIR ${PROJECT_SOURCE_DIR}/test/marine/testinput)
set(TESTREF_DIR ${PROJECT_SOURCE_DIR}/test/marine/testref)
set(PYIODACONV_DIR "${PROJECT_SOURCE_DIR}/build/lib/python3.10/")


# prepare a test.yaml file from test.yaml.in by replacing
Expand Down

0 comments on commit 5fb52d3

Please sign in to comment.