在网上找了很多,直接用都不行,试了半天的到以下的结果。

cmake_minimum_required(VERSION 2.8)
project( test )
include_directories (/usr/local/Cellar/leptonica/1.72/include /usr/local/Cellar/tesseract/3.04.01_1/include)
link_directories (/usr/local/Cellar/leptonica/1.72/lib /usr/local/Cellar/tesseract/3.04.01_1/lib)
add_executable( test main.cpp )
target_link_libraries( test lept tesseract)

其中的include_directories()语句位置可在add_executable() 语句的上方或下方,但是:

link_directories()语句一定要在add_executable() 语句的上方,并且:

target_link)libraries()语句一定要在add_executable() 语句的下方。

posted on 2016-05-25 14:39  即将踏上社会的人  阅读(431)  评论(0编辑  收藏  举报