2011-01-11 56 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) 
相关问题