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

Fix usage of FindGzOGRE2 on Windows when pkg-config is available #357

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 3 additions & 5 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,8 +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 +144,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 @@ -393,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