开发者

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

开发者 https://www.devze.com 2023-02-04 03:57 出处:网络
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.

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)
0

精彩评论

暂无评论...
验证码 换一张
取 消