2011-01-11 59 views
2

我在c:\ cppunit \ lib中有一個庫,在c:\ cppunit \ include中有一個頭文件。 我想出了這個cmake文件來構建庫。如何讓CMake知道庫在某個目錄下?

如何讓CMake知道庫在c:/ cppunit/lib?

PROJECT(cppunitest) 
INCLUDE_DIRECTORIES("c:/cppunit/include") 
??? How to let CMake to know the library is in c:/cppunit/lib 
SET(cppunitest_SRC main.cpp testset.cpp complex.cpp ) 
LINK_LIBRARIES(cppunit) 
ADD_EXECUTABLE(cpptest ${cppunitest_SRC}) 

回答

4

你應該這樣做:

LINK_DIRECTORIES("c:/cppunit/lib") 
ADD_EXECUTABLE(cpptest ${cppunitest_SRC}) 
LINK_LIBRARIES(cpptest cppunit) 
相關問題