Skip to content

Commit 79ffedb

Browse files
committed
[CMake] Fixup Keras version check for tutorials
The Keras version check that was introduced in 2ddaee3 should only be done if Keras is found. Otherwise, we get wrong warnings about how the Keras version could not be determined
1 parent 95320d1 commit 79ffedb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tutorials/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ else()
349349
# Keras tutorials. This mirrors the logic in tmva/sofie/test/CMakeLists.txt.
350350
# TODO: make sure we also support the newest Keras
351351
set(unsupported_keras_version "3.5.0")
352-
if (NOT DEFINED ROOT_KERAS_VERSION)
352+
if (ROOT_KERAS_FOUND AND NOT DEFINED ROOT_KERAS_VERSION)
353353
message(WARNING "Keras found, but version unknown — cannot verify compatibility.")
354-
elseif (NOT ROOT_KERAS_VERSION VERSION_LESS ${unsupported_keras_version})
354+
elseif (ROOT_KERAS_FOUND AND NOT ROOT_KERAS_VERSION VERSION_LESS ${unsupported_keras_version})
355355
message(WARNING "Keras version ${ROOT_KERAS_VERSION} is too new for the SOFIE Keras parser (only supports < ${unsupported_keras_version}). Corresponding tutorials will not be tested.")
356356
set(keras_unsupported TRUE)
357357
endif()

0 commit comments

Comments
 (0)