From 3969bccbf947fe044910b4be18c0d2582d5b4323 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Thu, 1 Jul 2021 11:21:57 -0700 Subject: [PATCH] set ogre var to empty string, fix pkg result check, typo Signed-off-by: Ian Chen --- cmake/FindIgnOGRE.cmake | 16 ++++++---------- cmake/FindIgnOGRE2.cmake | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/cmake/FindIgnOGRE.cmake b/cmake/FindIgnOGRE.cmake index 08fc7a35..1bb1008f 100644 --- a/cmake/FindIgnOGRE.cmake +++ b/cmake/FindIgnOGRE.cmake @@ -69,7 +69,7 @@ if (NOT WIN32) RESULT_VARIABLE _pkgconfig_failed) if(_pkgconfig_failed) IGN_BUILD_WARNING ("Failed to get pkg-config search paths") - elseif (NOT "_pkgconfig_invoke_result" STREQUAL "") + elseif (NOT _pkgconfig_invoke_result STREQUAL "") set (PKG_CONFIG_PATH_TMP "${PKG_CONFIG_PATH_TMP}:${_pkgconfig_invoke_result}") endif() @@ -83,16 +83,13 @@ if (NOT WIN32) # loop through pkg config paths and find an ogre version that is < 2.0.0 foreach(pkg_path ${PKG_CONFIG_PATH_TMP}) - if (NOT EXISTS ${pkg_path}) continue() endif() - - unset(OGRE_FOUND) - unset(OGRE_INCLUDE_DIRS) - unset(OGRE_LIBRARY_DIRS) - unset(OGRE_LIBRARIES) - + set(OGRE_FOUND false) + set(OGRE_INCLUDE_DIRS "") + set(OGRE_LIBRARY_DIRS "") + set(OGRE_LIBRARIES "") set(ENV{PKG_CONFIG_PATH} ${pkg_path}) ign_pkg_check_modules_quiet(OGRE "OGRE >= ${full_version}" NO_CMAKE_ENVIRONMENT_PATH @@ -109,7 +106,7 @@ if (NOT WIN32) if(_pkgconfig_failed) IGN_BUILD_WARNING ("Failed to find OGRE's library directory. The build will succeed, but there will likely be run-time errors.") else() - # set ogre library dir and strip line brak + # set ogre library dir and strip line break set(OGRE_LIBRARY_DIRS ${_pkgconfig_invoke_result}) string(REGEX REPLACE "\n$" "" OGRE_LIBRARY_DIRS "${OGRE_LIBRARY_DIRS}") @@ -145,7 +142,6 @@ if (NOT WIN32) ign_pkg_check_modules_quiet(IgnOGRE-${component} "OGRE-${component} >= ${full_version}" NO_CMAKE_ENVIRONMENT_PATH) if(IgnOGRE-${component}_FOUND) list(APPEND OGRE_LIBRARIES IgnOGRE-${component}::IgnOGRE-${component}) - elseif(IgnOGRE_FIND_REQUIRED_${component}) set(OGRE_FOUND false) endif() diff --git a/cmake/FindIgnOGRE2.cmake b/cmake/FindIgnOGRE2.cmake index 2d626db8..443d2efa 100644 --- a/cmake/FindIgnOGRE2.cmake +++ b/cmake/FindIgnOGRE2.cmake @@ -110,7 +110,7 @@ if (NOT WIN32) RESULT_VARIABLE _pkgconfig_failed) if(_pkgconfig_failed) IGN_BUILD_WARNING ("Failed to get pkg-config search paths") - elseif (NOT "_pkgconfig_invoke_result" STREQUAL "") + elseif (NOT _pkgconfig_invoke_result STREQUAL "") set (PKG_CONFIG_PATH_TMP "${PKG_CONFIG_PATH_TMP}:${_pkgconfig_invoke_result}") endif()