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

FindVorbis.cmake is producing warnings that end up getting passed to the end user #2201

Closed
bjumbeck opened this issue Sep 14, 2022 · 3 comments

Comments

@bjumbeck
Copy link

Subject of the issue

FindVorbis.cmake is producing the following warning.

CMake Warning (dev) at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/FindPackageHandleStandardArgs.cmake:438 (message):The package name passed to `find_package_handle_standard_args` (VORBIS)
does not match the name of the calling package (Vorbis).  This can lead to
problems in calling code that expects `find_package` result variables
(e.g., `_FOUND`) to follow a certain pattern.

Which is coming from a mismatch in the FindVorbis.cmake at Line 25 find_package_handle_standard_args(VORBIS DEFAULT_MSG VORBIS_LIBRARIES VORBIS_INCLUDE_DIR OGG_INCLUDE_DIR)

This is by no means critical, and isn't causing any issues as far as I can tell since it isn't really exposed to end users. Though it is still passing the warning to the end user in certain cases which should be avoided where possible, and it's a simple fix (Changing find_package_handle_standard_args's target to Vorbis).

Your environment

  • Windows 11
  • SFML 2.5.1 and CMake 3.22

Steps to reproduce

Using the following CMake build script you can reproduce the warning.

# CMAKE Setup
########################################
cmake_minimum_required(VERSION 3.11...3.20)
if(${CMAKE_VERSION} VERSION_LESS 3.12)
    cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
endif()

include(FetchContent)

# Project Structure
########################################
project(TestProject VERSION 1.0 DESCRIPTION "Testing Project" LANGUAGES CXX)
add_executable(TestProject main.cpp)
set(FETCHCONTENT_BASE_DIR "${PROJECT_SOURCE_DIR}/ThirdParty")

# Dependency Fetching
########################################
FetchContent_Declare(
    sfml
    GIT_REPOSITORY "https://github.com/SFML/SFML.git"
    GIT_TAG        "2.5.1"
)

FetchContent_GetProperties(sfml)
if(NOT sfml_POPULATED)
    FetchContent_Populate(sfml)
    add_subdirectory(${sfml_SOURCE_DIR} ${sfml_BINARY_DIR})
endif()


# Dependency Linking
########################################
target_link_libraries(TestProject 
    PRIVATE
        sfml-audio
        sfml-graphics
        sfml-system
        sfml-window
)
@eXpl0it3r
Copy link
Member

This was already fixed on the 2.6.x and master branch with #1637 and #1636 🙂

@bjumbeck
Copy link
Author

Ahh perfect ty will upgrade to that my bad about the issue spam then.

@bjumbeck bjumbeck reopened this Sep 14, 2022
@eXpl0it3r
Copy link
Member

No worries 🙂

@eXpl0it3r eXpl0it3r added this to Discussion in SFML 2.6.0 via automation Sep 15, 2022
@eXpl0it3r eXpl0it3r added this to the 2.6 milestone Sep 15, 2022
@eXpl0it3r eXpl0it3r moved this from Discussion to Done in SFML 2.6.0 Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SFML 2.6.0
  
Done
Development

No branches or pull requests

2 participants