柯南找不到安装好的软件包

时间:2019-06-27 12:43:28

标签: cmake conan

我有一个只有头的柯南包,其中包含以下conanfile.py:

class KVAPIConan(ConanFile):
    name = "kvapi"
    version = "0.1.0.0"
    description = "Kiwi API library"
    exports_sources = "include/*"
    topics = ("kv", "kvapi", "C++")
    no_copy_source = True

    def package(self):
        self.copy("*.hpp")

    def package_id(self):
        self.info.header_only()

我使用以下命令行创建并上传:

conan create . kvapi/0.1.0.0@kiwi/testing
conan upload kvapi/0.1.0.0@kiwi/testing --all -r genetec

我有第二个项目将此软件包列为依赖项:

def requirements(self):
        self.requires("kvapi/0.1.0.0@kiwi/testing")

但是,当我尝试从CMake为第二个项目生成一个项目时,它无法说明找不到依赖项:

1> Command line: C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe  -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\RHPACHECO\CMakeBuilds\48e4aeef-8f2f-7238-b8f8-091c79dd38c3\install\x64-Debug (default)"  -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Users\RHPACHECO\Desktop\kv\CMakeBasedCore\kvcore"
1> Working directory: C:\Users\RHPACHECO\CMakeBuilds\48e4aeef-8f2f-7238-b8f8-091c79dd38c3\build\x64-Debug (default)
1> -- clang-format found: C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/Common7/IDE/VC/vcpackages/clang-format.exe
1> CMake Error at src/CMakeLists.txt:142 (find_package):
1>   By not providing "Findkvapi.cmake" in CMAKE_MODULE_PATH this project has
1>   asked CMake to find a package configuration file provided by "kvapi", but
1>   CMake did not find one.
1> 
1>   Could not find a package configuration file provided by "kvapi" with any of
1>   the following names:
1> 
1>     kvapiConfig.cmake
1>     kvapi-config.cmake
1> 
1>   Add the installation prefix of "kvapi" to CMAKE_PREFIX_PATH or set
1>   "kvapi_DIR" to a directory containing one of the above files.  If "kvapi"
1>   provides a separate development package or SDK, be sure it has been
1>   installed.
1> 
1> 
1> -- Configuring incomplete, errors occurred!
1> See also "C:/Users/RHPACHECO/CMakeBuilds/48e4aeef-8f2f-7238-b8f8-091c79dd38c3/build/x64-Debug (default)/CMakeFiles/CMakeOutput.log".
1> C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe  -G "Ninja" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\RHPACHECO\CMakeBuilds\48e4aeef-8f2f-7238-b8f8-091c79dd38c3\install\x64-Debug (default)"  -DCMAKE_CXX_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_C_COMPILER="C:/Program Files (x86)/Microsoft Visual Studio/2017/Enterprise/VC/Tools/MSVC/14.16.27023/bin/HostX64/x64/cl.exe"  -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_MAKE_PROGRAM="C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO\2017\ENTERPRISE\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\Ninja\ninja.exe" "C:\Users\RHPACHECO\Desktop\kv\CMakeBasedCore\kvcore" returned with exit code: 1
CMake Error at src/CMakeLists.txt:142 (find_package):
  By not providing "Findkvapi.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "kvapi", but
  CMake did not find one.
  Could not find a package configuration file provided by "kvapi" with any of
  the following names:
    kvapiConfig.cmake
    kvapi-config.cmake
  Add the installation prefix of "kvapi" to CMAKE_PREFIX_PATH or set
  "kvapi_DIR" to a directory containing one of the above files.  If "kvapi"
  provides a separate development package or SDK, be sure it has been
  installed.

第二个项目将cmake_find_package定义为生成器,我在CMAKE_BINARY_DIR中添加了CMAKE_MODULE_PATH

list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})

我该如何调试呢?

1 个答案:

答案 0 :(得分:0)