diff --git a/Changelog.md b/Changelog.md index 62be13ad..da3ceabd 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,6 +1,9 @@ ## Ignition CMake 2.x -### Ignition CMake 2.X.X (20XX-XX-XX) +### Ignition CMake 2.X.X (2021-08-23) + +1. Fix problems on IgnOGRE.cmake when version is not found + * [Pull request #175](https://github.com/ignitionrobotics/ign-cmake/pull/175) ### Ignition CMake 2.8.0 (2021-04-30) diff --git a/cmake/FindIgnOGRE.cmake b/cmake/FindIgnOGRE.cmake index 1bb1008f..e00f6193 100644 --- a/cmake/FindIgnOGRE.cmake +++ b/cmake/FindIgnOGRE.cmake @@ -238,28 +238,27 @@ else() endif() endif() -# manually search and append the the RenderSystem/GL path to -# OGRE_INCLUDE_DIRS so OGRE GL headers can be found -foreach (dir ${OGRE_INCLUDE_DIRS}) - get_filename_component(dir_name "${dir}" NAME) - if("${dir_name}" STREQUAL "OGRE") - if(${OGRE_VERSION} VERSION_LESS 1.11.0) - set(dir_include "${dir}/RenderSystems/GL") - else() - set(dir_include "${dir}/RenderSystems/GL" "${dir}/Paging") - endif() - else() - set(dir_include "${dir}") - endif() - list(APPEND OGRE_INCLUDE_DIRS ${dir_include}) -endforeach() - set(IgnOGRE_FOUND false) if(OGRE_FOUND) set(IgnOGRE_FOUND true) - include(IgnImportTarget) + # manually search and append the the RenderSystem/GL path to + # OGRE_INCLUDE_DIRS so OGRE GL headers can be found + foreach(dir ${OGRE_INCLUDE_DIRS}) + get_filename_component(dir_name "${dir}" NAME) + if("${dir_name}" STREQUAL "OGRE") + if(${OGRE_VERSION} VERSION_LESS 1.11.0) + set(dir_include "${dir}/RenderSystems/GL") + else() + set(dir_include "${dir}/RenderSystems/GL" "${dir}/Paging") + endif() + else() + set(dir_include "${dir}") + endif() + list(APPEND OGRE_INCLUDE_DIRS ${dir_include}) + endforeach() + include(IgnImportTarget) ign_import_target(IgnOGRE TARGET_NAME IgnOGRE::IgnOGRE LIB_VAR OGRE_LIBRARIES