I'm trying to find a library that's built alongside a subsection of a project, the library is built with a "externalproject_add" call and builds successfully. It puts a library (.so.2) in a subdirectory within itself
I've specified a directory with PATHS (I've also tried HINTS, and adding the trailing /lib as part of the path), and am using debug mode to get CMake to print the information as it tries to find this library.
find_library(METADX1_LIB NAMES libmdx1host.so.2 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/meta-dx1/sdk/builds/debug/ PATH_SUFFIXES lib NO_DEFAULT_PATH)
I'm very clear here about the path I have my library in. I've also tried suspending the leading lib, trailing *.so.2, etc to no avail, it looks like CMake isn't even trying:
CMake Debug Log at Sub-project/CMakeLists.txt:187 (find_library):
find_library called with the following settings:
VAR: METADX1_LIB
NAMES: "libmdx1host.so.2"
Documentation: Path to a library.
Framework
Only Search Frameworks: 0
Search Frameworks Last: 0
Search Frameworks First: 0
AppBundle
Only Search AppBundle: 0
Search AppBundle Last: 0
Search AppBundle First: 0
NO_DEFAULT_PATH Enabled
find_library considered the following locations:
The item was not found.
If I supply /usr/bin as a path to PATHS as an experiment, CMake appends that to some output directory somewhere deep within the project, even though it's an absolute path.
I'm finding CMake to be extremely counterintuitive. I've given it an exact location where there is a library, how can I get it to actually look in that directory?
Edit
IT seems find_library is modifying the paths for some reason:
CMake Debug Log at TMX-4400/CMakeLists.txt:190 (find_library):
find_library(METADX1_LIB) removed original suffix
/home/brydon/embedded/product/../../tools/optelinux/bdrt/output/rootfs.tmx4400/staging/home/brydon/embedded/product/TMX-4400/meta-dx1/sdk/builds/debug/
from PATH_SUFFIXES while adding architecture paths for suffix '64'