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()
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 havingfind_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):