prosseek
prosseek

Reputation: 190799

How to let CMake to know the library is in some directory?

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/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})

Upvotes: 2

Views: 415

Answers (1)

tibur
tibur

Reputation: 11636

You should do:

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

Upvotes: 4

Related Questions