Makefile 如何让CMake知道库在某个目录中?

Makefile 如何让CMake知道库在某个目录中?,makefile,cmake,Makefile,Cmake,我在c:\cppunit\lib中有一个库,在c:\cppunit\include中有一个头文件。 我提出了这个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 mai

我在c:\cppunit\lib中有一个库,在c:\cppunit\include中有一个头文件。 我提出了这个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})
你应该做:

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