Skip to content

Commit

Permalink
Fixed finding Ogre2 on Windows+Conda. (#384)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Pecka <[email protected]>
  • Loading branch information
peci1 authored Sep 14, 2023
1 parent ec97ec2 commit ba4b99b
Showing 1 changed file with 6 additions and 6 deletions.
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.

0 comments on commit ba4b99b

Please sign in to comment.