Skip to content

CMake: flac-config.cmake is missing find_dependency(Threads) #820

Description

@z-s-e

The cmake Package Configuration File should find all dependencies that the targets need, otherwise configuration fails.

Right now, doing find_package(FLAC REQUIRED) in a project fails, unless one uses the work-around of having find_package(Threads REQUIRED) beforehand, which is not so nice.

I believe all that needs to be done here is adding the following lines to flac-config.cmake.in after the include(CMakeFindDependencyMacro):

if(@HAVE_PTHREAD@)
    set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
    set(THREADS_PREFER_PTHREAD_FLAG TRUE)
    find_dependency(Threads)
endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions