2013-05-01 116 views
2

我正在嘗試使用CMake構建Polycode代碼。我跟着Build.md文件中的指令,但我得到了以下錯誤:使用CMake構建時缺少依賴關係

$ 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並下載它,但是我並不是真的想用它可能需要的每一個lib來做到這一點。有沒有一種方便的方法來解決這個問題?

回答

2

這是一個兩步構建過程。首先,您需要構建依賴項:

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" .. 
+0

哇我應該更仔細地閱讀它。 – nosferat 2013-05-01 13:26:29

+0

@nosferat沒有問題,因爲區別在單行'cd Dependencies'中,所以很容易理解。 – TemplateRex 2013-05-01 13:28:51