sparkFinder
sparkFinder

Reputation: 3394

CMake Link to External Library without Package finder

I have a precompiled library that I have to make visible to my Cmake project, and I don't understand how I would use the package finder in Cmake to find that library. The external library itself has nothing to do with CMake. Anyone have any suggestions?

Cheers.

Upvotes: 2

Views: 3803

Answers (2)

sparkFinder
sparkFinder

Reputation: 3394

A few days later, I post; What ended up working for me was:

link_directories("${PROJECT_SOURCE_DIR}/ext/lib")

Where ext/lib has external precompiled libraries. I didn't want to link just to a specific target.

Upvotes: 5

tibur
tibur

Reputation: 11626

include_directories(path/to/my/library/headers)
target_link_libraries(myTarget path/to/my/library.so|.dll)

Upvotes: 2

Related Questions