Vcpkg: portaudio_x64.lib not found by portaudioTargets.cmake

Created on 31 Oct 2019  路  7Comments  路  Source: microsoft/vcpkg

Describe the bug
When I try to import portaudio in an external CMake-project, the configuration phase fails.

Environment

  • OS: Windows
  • Compiler: Visual Studio 2017

To Reproduce
Steps to reproduce the behavior:
1..\vcpkg install portaudio --triplet x64-windows

  1. Call find_package(portaudio CONFIG REQUIRED) in a CMakeLists.txt file

Expected behavior
As can be seen in the Failure logs section, portaudioTargets.cmake is looking for <vcpkg-root>/installed/x64-windows/debug/lib/portaudio_x64.lib file, however vcpkg installs a file called
<vcpkg-root>/installed/x64-windows/debug/lib/portaudio.lib

See the following lines for further details:
https://github.com/microsoft/vcpkg/blob/81fbbf8d964c111063b1e58dac61bc20c38e37f9/ports/portaudio/portfile.cmake#L31-L32

Failure logs
This is the output of cmake

CMake Error at C:/Users/icub/Documents/icub_ws/vcpkg/installed/x64-windows/share/portaudio/portaudioTargets.cmake:72 (message):
  The imported target "portaudio" references the file

     "C:/Users/icub/Documents/icub_ws/vcpkg/installed/x64-windows/debug/lib/portaudio_x64.lib"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "C:/Users/icub/Documents/icub_ws/vcpkg/installed/x64-windows/share/portaudio/portaudioTargets.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  C:/Users/icub/Documents/icub_ws/vcpkg/installed/x64-windows/share/portaudio/portaudioConfig.cmake:1 (include)
  C:/Users/icub/Documents/icub_ws/vcpkg/scripts/buildsystems/vcpkg.cmake:263 (_find_package)
  CMakeLists.txt:29 (find_package)

Additional context
The bug can be reproduced running the following cmake file: CMakeLists.txt

@traversaro @MiladShafiee

port-bug

All 7 comments

Note that this is issue means that https://github.com/microsoft/vcpkg/issues/8343 was not actually solved, and instead https://github.com/microsoft/vcpkg/pull/8399 introduced a regression for all portaudio CMake users. cc @NancyLi1013

Note that this problem would have catched early if the portaudio port contained the command vcpkg_test_cmake(PACKAGE_NAME portaudio), and if this command was not disabled in https://github.com/microsoft/vcpkg/commit/c2ad1baafccc91bf7e9e60a390eb91cf4e130062 .

Hi @GiulioRomualdi , thanks for posting this issue. I have submitted a PR to fix this issue. Could you help try to confirm whether it work for you?
@traversaro thanks for your comments. I'm so sorry about this issue.

@traversaro thanks for your comments. I'm so sorry about this issue.

No problem at all, thanks for working on the issue in the first place andfor all the work that you and the team puts on maintaining vcpkg.
The only 100% sure way of not introducing regressions is not working on something at all. : )

Dear @NancyLi1013 , the PR fixes that problem, now portaudio is found by cmake.

However #include<portaudio.h> failed with the following error

Cannot open include file: 'portaudio.h': No such file or directory

The problem is fixed if I add the following lines in the portaudioTargets.cmake

set_target_properties(portaudio PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/../../include")
set_target_properties(portaudio_static PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_LIST_DIR}/../../include")

@traversaro thanks again for your understand.
@GiulioRomualdi thanks for posting this new problem. I will investigate this issue and try to fix it as soon as possible.

Hi @GiulioRomualdi I just submitted a commit to fix the include file cannot be found. Please help confirm again and if it can work for you.

Thanks for your patience.

The PR has been merged. Please try to update vcpkg and use it.

Was this page helpful?
0 / 5 - 0 ratings