From d760afb386cf353e8cbb75930328d2203caef4bd Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Tue, 12 Oct 2021 00:23:51 +0200 Subject: [PATCH 1/2] Fix logic on warning for ogre versions different than 1.9.x Signed-off-by: Jose Luis Rivero --- CMakeLists.txt | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 95f568dc5..b5ff7e1c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,28 +61,19 @@ endif() # Find OGRE list(APPEND ign_ogre_components "RTShaderSystem" "Terrain" "Overlay") -# Ogre versions greater than 1.9 are not officialy supported. +ign_find_package(IgnOGRE VERSION 1.9.0 + COMPONENTS ${ign_ogre_components} + REQUIRED_BY ogre + PRIVATE_FOR ogre) + +# Ogre versions different than 1.9.x are not officialy supported. # Display a warning for the users on this setup unless they provide # USE_UNOFFICIAL_OGRE_VERSIONS flag if (NOT USE_UNOFFICIAL_OGRE_VERSIONS) - # Only for checking the ogre version - ign_find_package(IgnOGRE VERSION 1.10 QUIET) - - if (OGRE_FOUND) - IGN_BUILD_WARNING("Ogre 1.x versions greater than 1.9 are not officially supported." + if ((${OGRE_VERSION} VERSION_LESS 1.9.0) OR (${OGRE_VERSION} VERSION_GREATER_EQUAL 1.10.0)) + IGN_BUILD_WARNING("Ogre 1.x versions different than 1.9 are not officially supported." "The software might compile and even work but support from upstream" "could be reduced to accepting patches for newer versions") - ign_find_package(IgnOGRE VERSION 1.10 - COMPONENTS ${ign_ogre_components} - REQUIRED_BY ogre - PRIVATE_FOR ogre) - else() - # If ogre 1.10 or greater was not found, then proceed to look for 1.9.x - # versions which are offically supported - ign_find_package(IgnOGRE VERSION 1.9.0 - COMPONENTS ${ign_ogre_components} - REQUIRED_BY ogre - PRIVATE_FOR ogre) endif() endif() From ad0b3506291189219eeb374f8fa25181da794bef Mon Sep 17 00:00:00 2001 From: Jose Luis Rivero Date: Fri, 15 Oct 2021 18:42:13 +0200 Subject: [PATCH 2/2] ogre versions lower than 1.9 can not be detected since find_package will skip them Signed-off-by: Jose Luis Rivero --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5ff7e1c4..05cf326fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,12 +66,12 @@ ign_find_package(IgnOGRE VERSION 1.9.0 REQUIRED_BY ogre PRIVATE_FOR ogre) -# Ogre versions different than 1.9.x are not officialy supported. +# Ogre versions greater than 1.9.x are not officialy supported. # Display a warning for the users on this setup unless they provide # USE_UNOFFICIAL_OGRE_VERSIONS flag if (NOT USE_UNOFFICIAL_OGRE_VERSIONS) - if ((${OGRE_VERSION} VERSION_LESS 1.9.0) OR (${OGRE_VERSION} VERSION_GREATER_EQUAL 1.10.0)) - IGN_BUILD_WARNING("Ogre 1.x versions different than 1.9 are not officially supported." + if (${OGRE_VERSION} VERSION_GREATER_EQUAL 1.10.0) + IGN_BUILD_WARNING("Ogre 1.x versions greater than 1.9 are not officially supported." "The software might compile and even work but support from upstream" "could be reduced to accepting patches for newer versions") endif()