Describe the bug
Linking to the port azure_kinect_sensor_sdk failed
Environment
To Reproduce
Steps to reproduce the behavior:
find_package(k4a CONFIG REQUIRED)
target_link_libraries(main PRIVATE k4a::k4a)
Failure logs
CMake Error at libs/vcpkg/installed/x64-windows-md/share/k4a/k4aTargets.cmake:73 (message):
The imported target "k4a::k4a" references the file
"./vcpkg/installed/x64-windows-md/debug/bin/k4a.dll"
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
"./vcpkg/installed/x64-windows-md/share/k4a/k4aTargets.cmake"
but not all the files it references.
Additional context
I requested a static linkage with this library
I am doing something wrong?
Cheers
A temporary fix is to remove all reference to k4a.dll in the k4aTargets-debug/release.cmake :
#----------------------------------------------------------------
# Generated CMake target import file for configuration "Release".
#----------------------------------------------------------------
# Commands may need to know the format version.
set(CMAKE_IMPORT_FILE_VERSION 1)
# Import target "k4a::k4a" for configuration "Release"
set_property(TARGET k4a::k4a APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(k4a::k4a PROPERTIES
IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/k4a.lib"
#IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/k4a.dll"
)
list(APPEND _IMPORT_CHECK_TARGETS k4a::k4a )
list(APPEND _IMPORT_CHECK_FILES_FOR_k4a::k4a "${_IMPORT_PREFIX}/lib/k4a.lib" )#"${_IMPORT_PREFIX}/bin/k4a.dll" )
# Commands beyond this point should not need to know the version.
set(CMAKE_IMPORT_FILE_VERSION)
carefull, these files are auto-generated
After testing on Ubuntu 18.04 LTS, it seems the package can't neither build there, with the following error :
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: /home/simulator/Desktop/update/imt/libs/vcpkg/downloads/tools/cmake-3.14.0-linux/cmake-3.14.0-Linux-x86_64/bin/cmake /home/simulator/Desktop/update/imt/libs/vcpkg/buildtrees/azure-kinect-sensor-sdk/src/.0-alpha.0-30d96b3859.clean -DK4A_BUILD_DOCS=OFF -DBUILD_TOOLS=OFF -DK4A_SOURCE_LINK=OFF -DK4A_MTE_VERSION=ON -DBUILD_EXAMPLES=OFF -DWITH_TEST=OFF -DIMGUI_EXTERNAL_PATH=/home/simulator/Desktop/update/imt/libs/vcpkg/installed/x64-linux-dyn/include/bindings -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DCMAKE_SYSTEM_NAME=Linux -DBUILD_SHARED_LIBS=OFF -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=/home/simulator/Desktop/update/imt/libs/vcpkg/scripts/toolchains/linux.cmake -DVCPKG_TARGET_TRIPLET=x64-linux-dyn -DVCPKG_SET_CHARSET_FLAG=ON -DVCPKG_PLATFORM_TOOLSET=external -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON -DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON -DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON -DVCPKG_APPLOCAL_DEPS=OFF -DCMAKE_TOOLCHAIN_FILE=/home/simulator/Desktop/update/imt/libs/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON -DVCPKG_CXX_FLAGS= -DVCPKG_CXX_FLAGS_RELEASE= -DVCPKG_CXX_FLAGS_DEBUG= -DVCPKG_C_FLAGS= -DVCPKG_C_FLAGS_RELEASE= -DVCPKG_C_FLAGS_DEBUG= -DVCPKG_CRT_LINKAGE=dynamic -DVCPKG_LINKER_FLAGS= -DVCPKG_TARGET_ARCHITECTURE=x64 -DCMAKE_INSTALL_LIBDIR:STRING=lib -DCMAKE_INSTALL_BINDIR:STRING=bin -D_VCPKG_ROOT_DIR=/home/simulator/Desktop/update/imt/libs/vcpkg -D_VCPKG_INSTALLED_DIR=/home/simulator/Desktop/update/imt/libs/vcpkg/installed -DVCPKG_MANIFEST_INSTALL=OFF -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/home/simulator/Desktop/update/imt/libs/vcpkg/packages/azure-kinect-sensor-sdk_x64-linux-dyn/debug
Working Directory: /home/simulator/Desktop/update/imt/libs/vcpkg/buildtrees/azure-kinect-sensor-sdk/x64-linux-dyn-dbg
Error code: 1
See logs for more information:
/home/simulator/Desktop/update/imt/libs/vcpkg/buildtrees/azure-kinect-sensor-sdk/config-x64-linux-dyn-dbg-out.log
/home/simulator/Desktop/update/imt/libs/vcpkg/buildtrees/azure-kinect-sensor-sdk/config-x64-linux-dyn-dbg-err.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:309 (vcpkg_execute_required_process)
ports/azure-kinect-sensor-sdk/portfile.cmake:24 (vcpkg_configure_cmake)
scripts/ports.cmake:79 (include)
the error in the file is :
CMake Error at /home/simulator/Desktop/update/imt/libs/vcpkg/scripts/buildsystems/vcpkg.cmake:441 (_find_package):
Could not find a package configuration file provided by "gtest" with any of
the following names:
gtestConfig.cmake
gtest-config.cmake
Add the installation prefix of "gtest" to CMAKE_PREFIX_PATH or set
"gtest_DIR" to a directory containing one of the above files. If "gtest"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
CMakeLists.txt:104 (find_package)
These files exists and the package gtest:x64-linux-dyn is installed...
Hi @aspioupiou
Thanks for posting this issue.
Do you have some changes in your triplet? I noticed that you build azure-kinect-sensor-sdk:x64-windows-md.
I try to build azure-kinect-sensor-sdk:x64-windows and there is no any error about this.
@NancyLi1013 Hi !
There exists 2 issues here :
./vcpkg install azure-kinect-sensor-sdk:x64-linuxWindows build works great here, only linking on this platform is an issue
Hi @aspioupiou
If you want to build static, you should try to install azure-kinect-sensor-sdk:x64-windows-static first, then use it in your project.
For the linkage issue, there is no error when I build azure-kinect-sensor-sdk:x64-windows.(Note: Not just install it, I also build the project that this port used)
For the build issue on Linux, the result is as expected. Since azure-kinect-sensor-sdk currently doesn't support Linux and OSX.
Please see here.
https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt#L95
I think it would be better to add Supports: !(linux | osx)to CONTROL file and also add the unsupported message in portfile.cmake to remind the users.
I think it would be better to add Supports: !(linux | osx) to CONTROL file and also add the unsupported message in portfile.cmake to remind the users. Yes, definitely this is a good idea since I thought a message would be displayed if trying to install a package on an incompatible platform.
For the windows link stuff, I'm AFO at the moment, I will try and tell you the result as soon as I'm back !
Thank you !
Hi @aspioupiou
Any updates about this?
Hi,
Good for me now, I think we can close this one !
Cool! Thanks for your feedback.
I'm closing this issue for now.