I have a library in c:\cppunit\lib, and a header files in c:\cppunit\include. I come up with this cmake file to build with the library.
How to let CMake to know the library is in c:/cppunit/lib?
PROJECT( cppunitest )
INCLUDE_DIRECTORIES( "c:/cppunit/开发者_JAVA百科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})
You should do:
LINK_DIRECTORIES("c:/cppunit/lib")
ADD_EXECUTABLE( cpptest ${cppunitest_SRC})
LINK_LIBRARIES(cpptest cppunit)
精彩评论