Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed finding Ogre2 on Windows+Conda. #384

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmake/FindGzOGRE2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# to be set before calling find_package:
#
# GZ_OGRE2_PROJECT_NAME Possible values: OGRE2 (default) or OGRE-Next
# (Only on UNIX, not in use for Windows)
# Specify the project name used in the packaging.
# It will impact directly in the name of the
# CMake/pkg-config modules being used.
Expand All @@ -43,9 +42,6 @@
# OGRE2_RESOURCE_PATH Path to ogre plugins directory
# GzOGRE2::GzOGRE2 Imported target for OGRE2
#
# On Windows, we assume that all the OGRE* defines are passed in manually
# to CMake.
#
# Supports finding the following OGRE2 components: HlmsPbs, HlmsUnlit, Overlay,
# PlanarReflections
#
Expand Down Expand Up @@ -147,7 +143,8 @@ macro(get_preprocessor_entry CONTENTS KEYWORD VARIABLE)
endif ()
endmacro()

if (NOT WIN32)
find_package(PkgConfig QUIET)
if (PkgConfig_FOUND)
set(PKG_CONFIG_PATH_ORIGINAL $ENV{PKG_CONFIG_PATH})
foreach (GZ_OGRE2_PROJECT_NAME "OGRE2" "OGRE-Next")
message(STATUS "Looking for OGRE using the name: ${GZ_OGRE2_PROJECT_NAME}")
Expand Down Expand Up @@ -247,6 +244,8 @@ if (NOT WIN32)

set(OGRE2_INCLUDE_DIRS ${${GZ_OGRE2_PROJECT_NAME}_INCLUDE_DIRS}) # sync possible OGRE-Next to OGRE2

unset(OGRE2_INCLUDE CACHE)
unset(OGRE2_INCLUDE)
# verify ogre header can be found in the include path
find_path(OGRE2_INCLUDE
NAMES Ogre.h
Expand Down Expand Up @@ -392,7 +391,7 @@ if (NOT WIN32)
# because gz_pkg_check_modules does not work for it.
include(GzPkgConfig)
gz_pkg_config_library_entry(GzOGRE2 OgreMain)
else() #WIN32
else() #PkgConfig_FOUND

set(OGRE2_FOUND TRUE)
set(OGRE_LIBRARIES "")
Expand Down Expand Up @@ -579,3 +578,4 @@ endif()

set(IgnOGRE2_FOUND ${GzOGRE2_FOUND}) # TODO(CH3): Deprecated. Remove on tock.
set(IGN_PKG_NAME ${GZ_PKG_NAME}) # TODO(CH3): Deprecated. Remove on tock.