E
E
Egorithm2020-07-19 13:41:21
CMake
Egorithm, 2020-07-19 13:41:21

Why doesn't find_library() want to search inside CMAKE_LIBRARY_PATH?

It searches with the full path, but not so (see below).

set(CMAKE_LIBRARY_PATH C:/Users/me/Desktop/)

find_library(av_codec
    NAMES
        avcodec
    HINTS
         ffmpeg-4.3-win64-dev/lib
    REQUIRED
)

message(${av_codec})

How to explain it? Here it is written in black and white:
Semicolon-separated list of directories specifying a search path for the find_library() command

In addition, it REQUIREDdoes not break the configuration, despite the fact that av_codec-NOTFOUND(through message()). Are these CMake bugs or what?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egorithm, 2020-07-19
@EgoRusMarch

I figured it out, there is for this PATH_SUFFIXES, but PATHS/ HINTSdoes not work like that ( paths are not concatenated ):

set(CMAKE_LIBRARY_PATH C:/Users/march/Desktop/)

find_library(av_codec
    NAMES
        avcodec
    PATH_SUFFIXES
        ffmpeg-4.3-win64-dev/lib/
    REQUIRED
)

message(${av_codec})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question