2011-09-18 20 views
2

我試圖用最小的VPS構建最新版本的OpenCV,但卻遇到了CMake的麻煩。我不熟悉CMake,所以我很難解釋日誌輸出,因此如何着手調試問題。CMake在建設OpenCV時遇到的問題

從命令行(沒有安裝X11),並用devel/OpenCV的/ -2.3.1 /釋放內我發出以下

sudo cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local .. 

和這樣做的結果是:

-- Extracting svn version, please wait... 
-- SVNVERSION: exported 
-- Detected version of GNU GCC: 44 (404) 
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR) 
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR) 
-- Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR) 
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR) 
--  Use NumPy headers from: /usr/lib/python2.6/site-packages/numpy-1.6.1-py2.6-linux-i686.egg/numpy/core/include 
--  Found Sphinx 0.6.6: /usr/bin/sphinx-build 
-- Parsing 'cvconfig.h.cmake' 
-- 
-- General configuration for opencv 2.3.1 ===================================== 
-- 
--  Built as dynamic libs?:  YES 
--  Compiler:     /usr/bin/c++ 
--  C++ flags (Release):   -Wall -pthread -march=i686 -ffunction-sections -O3 -DNDEBUG -fomit-frame-pointer -msse -msse2 -mfpmath=387 -DNDEBUG\ 

--  C++ flags (Debug):   -Wall -pthread -march=i686 -ffunction-sections -g -O0 -DDEBUG -D_DEBUG -ggdb3 
--  Linker flags (Release): 
--  Linker flags (Debug): 
-- 
-- GUI: 
--  GTK+ 2.x:     NO 
--  GThread:     NO 
-- 
-- Media I/O: 
--  ZLib:      build 
--  JPEG:      build 
--  PNG:      build 
--  TIFF:      build 
--  JPEG 2000:     FALSE 
--  OpenEXR:     NO 
--  OpenNI:      NO 
--  OpenNI PrimeSensor Modules: NO 
--  XIMEA:      NO 
-- 
-- Video I/O: 
--  DC1394 1.x:     NO 
--  DC1394 2.x:     NO 
--  FFMPEG:      NO 
--  codec:     NO 
--  format:     NO 
--  util:      NO 
--  swscale:     NO 
--  gentoo-style:    NO 
--  GStreamer:     NO 
--  UniCap:      NO 
--  PvAPI:      NO 
--  V4L/V4L2:     FALSE/FALSE 
--  Xine:      NO 
-- 
-- Other third-party libraries: 
--  Use IPP:     NO 
--  Use TBB:     NO 
--  Use ThreadingFramework:  NO 
--  Use Cuda:     NO 
--  Use Eigen:     NO 
-- 
-- Interfaces: 
--  Python:      NO 
--  Python interpreter:   /usr/bin/python2.6 -B (ver 2.6) 
--  Python numpy:    YES 
--  Java:      NO 
-- 
-- Documentation: 
--  Sphinx:      /usr/bin/sphinx-build (ver 0.6.6) 
--  PdfLaTeX compiler:   NO 
--  Build Documentation:  NO 
-- 
-- Tests and samples: 
--  Tests:      YES 
--  Examples:     NO 
-- 
-- Install path:     /usr/local 
-- 
-- cvconfig.h is in:    /home/ec2-user/OpenCV-2.3.1/release 
-- ----------------------------------------------------------------- 
-- 
-- Configuring incomplete, errors occurred! 

此外,當我運行命令我也似乎得到在的CMakeLists.txt以下錯誤消息 CMake的錯誤:44(set_property):給定無效範圍CACHE set_property。有效的範圍是GLOBAL,目錄,目標,來源,測試 。

線42-45如下:

set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE) 
if(DEFINED CMAKE_BUILD_TYPE) 
    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${CMAKE_CONFIGURATION_TYPES}) 
endif() 

但是我不知道這是什麼意思? aNyone有沒有指針?

非常感謝

回答

0

我已經經歷了很多這是由錯誤版本的OpenCV引起的誤差建設的OpenCV。我使用cmake 3.0成功構建了opencv 3.0(儘管cmake 2.6不適合我)。然後,當我發現我必須降級到opencv 2.4.9時,我不得不返回到我的系統的默認cmake 2.6,因爲cmake 3.0不起作用。在opencv中運行cmake時檢查是否出現錯誤的第一件事是版本。