【问题标题】:Missing dependency when building with CMake使用 CMake 构建时缺少依赖项
【发布时间】:2013-04-25 11:18:57
【问题描述】:

我正在尝试使用 CMake 构建 Polycode 代码。我按照Build.md 文件中的说明进行操作,但出现以下错误:

$ cmake -G "Visual Studio 10" ..
No POLYCODE_RELEASE_DIR specified, to C:/Development/Polycode/Release/Windows
DEBUG CMAKE_PREFIX_PATH=C:/Development/Polycode/Release/Windows/Framework/Core/Dependencies;C:/Development/Polycode/Release/Windows/Framework/Modules/Dependencies;C:/Development/Polycode/Release/Windows/Framework/Tools/Dependencies
CMake Error at c:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
  c:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
  c:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindZLIB.cmake:85 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMake/PolycodeIncludes.cmake:14 (FIND_PACKAGE)
  Core/Contents/CMakeLists.txt:2 (INCLUDE)


-- Configuring incomplete, errors occurred!

我看到它需要 ZLIB,但我不知道如何处理。它不应该自动下载依赖项吗?我当然可以找到 ZLIB 并下载它,但我真的不想对它可能需要的每个库都这样做。有没有方便的方法来解决这个问题?

【问题讨论】:

    标签: c++ visual-studio-2010 build makefile cmake


    【解决方案1】:

    这是一个两步构建过程。首先你需要构建依赖:

    cd Dependencies  # <---- this will run the next steps in the Dependencies subdirectory of your Polycode repo
    mkdir Build
    cd Build
    cmake -G "Visual Studio 10" ..
    

    此步骤应安装所需的库。只有这样你才能继续构建 Polycode 本身

    # <---- this build step is run inside your Polycode root directory
    mkdir Build
    cd Build
    cmake -G "Visual Studio 10" ..
    

    【讨论】:

    • @nosferat 没问题,很容易掩盖这一点,因为区别在于单行 cd Dependencies
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多