2017-01-12 2 views
-1

Ich versuche, die erforderliche Bibliothek für meine cmake-Datei zu finden, aber ich kann sie nicht finden.cmake: unable to find_package()

Das ist mein Cmake Code:

find_package(myLib REQUIRED) 

Dies ist der Fehler msg, die gezeigt wird:

CMake Error at CMakeLists.txt:10 (find_package): 


By not providing "FindmyLib.cmake" in CMAKE_MODULE_PATH this project has 
    asked CMake to find a package configuration file provided by "myLib", but 
    CMake did not find one. 

    Could not find a package configuration file provided by "myLib" with any 
    of the following names: 

    myLibConfig.cmake 
    mylib-config.cmake 

    Add the installation prefix of "myLib" to CMAKE_PREFIX_PATH or set 
    "myLib_DIR" to a directory containing one of the above files. If 
    "myLib" provides a separate development package or SDK, be sure it has 
    been installed. 


-- Configuring incomplete, errors occurred! 

Kann ich weiß, wie diese zu beheben.

+1

Schwierige gesetzt hat, diese Frage zu beantworten. Beginnen Sie mit einem Blick hier: https://cmake.org/cmake/help/v3.0/command/find_package.html – oLen

+0

Bitte lesen Sie zuerst die Dokumentation und fragen Sie dann erneut https://cmake.org/cmake/help/ letzte/Befehl/find_library.html – usr1234567

Antwort

0

Vielleicht haben Sie den Ordner nicht zu CMAKE_MODULE_PATH hinzugefügt. Wenn Sie zum Beispiel FindmyLib.cmake im Ordner cmake/modules relativ zum CMakeList.txt Sie verwenden, fügen Sie

set(CMAKE_MODULE_PATH 
    ${CMAKE_MODULE_PATH} 
    ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules 
) 

in den ohne weitere Informationen CMakeList.txt

Verwandte Themen