cmake - benötigtes Paket fehlt. Welches paket

964
Colin747

Wann immer ich den Befehl ausführt:

cmake ..

Ich erhalte die folgende Fehlermeldung bezüglich eines fehlenden Pakets, aber ich kann anscheinend nicht finden, welches Paket gefunden werden kann.

-- Checking for module 'glib-2.0>=2.40' --  CMake Error at /Applications/CMake.app/Contents/share/cmake-3.7/Modules/FindPkgConfig.cmake:415 (message): A required package was not found Call Stack (most recent call first): /Applications/CMake.app/Contents/share/cmake-3.7/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal) CMakeLists.txt:7 (PKG_CHECK_MODULES)   -- Configuring incomplete, errors occurred! 

Ich habe versucht zu installieren:

pkg-config libgranite-dev libindicator3-dev libkeybinder-3.0-dev libvte-2.90-devund glib-2.0aber sie sind entweder nicht im Repository zu finden oder haben mein Problem nicht gelöst.

Ich benutze OSX mit brew.

CMakeLists.txt-Datei:

cmake_minimum_required (VERSION 3.0.0 FATAL_ERROR) project (tinyb)  FIND_PACKAGE (Threads REQUIRED) FIND_PACKAGE (PkgConfig REQUIRED)  PKG_CHECK_MODULES (GLIB2 REQUIRED glib-2.0>=2.40) PKG_CHECK_MODULES (GIO REQUIRED gio-2.0>=2.40) PKG_CHECK_MODULES (GIO-UNIX REQUIRED gio-unix-2.0>=2.40)  set (CMAKE_CXX_FLAGS_DEBUG "$ -Wall -Wextra -fno-omit-frame-pointer -DDEBUG") set (CMAKE_CXX_FLAGS_RELEASE "$ -Wall") set (LIB_INSTALL_DIR "lib$" CACHE PATH "Installation path for libraries")  # Set CMAKE_LIB_INSTALL_DIR if not defined include(GNUInstallDirs)  # Appends the cmake/modules path to MAKE_MODULE_PATH variable. set (CMAKE_MODULE_PATH $/cmake/modules $)  # Make a version file containing the current version from git. include (GetGitRevisionDescription) git_describe (VERSION "--tags")  if ("x_$" STREQUAL "x_GIT-NOTFOUND" OR "x_$" STREQUAL "x_HEAD-HASH-NOTFOUND" OR "x_$" STREQUAL "x_-128-NOTFOUND") message (WARNING " - Install git to compile a production libtinyb!") set (VERSION "v0.5.0-dirty") endif ()  message (INFO " - libtinyb Version $")  #parse the version information into pieces. string (REGEX REPLACE "^v([0-9]+)\\..*" "\\1" VERSION_MAJOR "$") string (REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" VERSION_MINOR "$") string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" VERSION_PATCH "$") string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+\\-([0-9]+).*" "\\1" VERSION_COMMIT "$") string (REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+-[0-9]+\\-(.*)" "\\1" VERSION_SHA1 "$") set (VERSION_SHORT "$.$.$") set (VERSION_API "$.$") string(TIMESTAMP BUILD_TSTAMP "%Y-%m-%d %H:%M:%S")  if ("$" MATCHES "^v.*") set (VERSION_COMMIT "") endif()  configure_file ($/cmake/modules/version.c.in $/src/version.c)  # this is the library version, independant of git revision set (tinyb_VERSION_MAJOR $) set (tinyb_VERSION_MINOR $) set (tinyb_VERSION_PATCH $) set (tinyb_VERSION_STRING "$.$.$")  set (CMAKE_SWIG_FLAGS "")  set (tinyb_DOCS_DIR documentation)  IF(WARNINGS) IF(UNIX) IF(CMAKE_COMPILER_IS_GNUCC) ADD_DEFINITIONS(-Wall -Wextra) ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(UNIX) ENDIF(WARNINGS)  IF(DEBUG) IF(UNIX) IF(CMAKE_COMPILER_IS_GNUCC) ADD_DEFINITIONS(-g -ggdb) ENDIF(CMAKE_COMPILER_IS_GNUCC) ENDIF(UNIX) ENDIF(DEBUG)  find_path (SYSTEM_USR_DIR "stdlib.h") include_directories ($)  option (BUILDJAVA "Build Java API." OFF)  IF(BUILDJAVA) configure_file ($/java/manifest.txt.in $/java/manifest.txt) add_subdirectory (java) add_subdirectory (examples/java) ENDIF(BUILDJAVA)  # add a target to generate API documentation with Doxygen find_package (Doxygen) if (DOXYGEN_FOUND) configure_file ($/Doxyfile.cpp.in $/Doxyfile.cpp.out @ONLY) if (BUILDJAVA) configure_file ($/Doxyfile.java.in $/Doxyfile.java.out @ONLY) add_custom_command (OUTPUT $/cpp $/java COMMAND $ -E make_directory $ COMMAND $ $/Doxyfile.cpp.out COMMAND $ $/Doxyfile.java.out DEPENDS $/api/tinyb/*.hpp $/java/*.java WORKING_DIRECTORY $ COMMENT "Generating API documentation with Doxygen" VERBATIM ) add_custom_target(doc DEPENDS $/cpp $/java) else () add_custom_command (OUTPUT $/cpp COMMAND $ -E make_directory $ COMMAND $ $/Doxyfile.cpp.out DEPENDS $/api/ WORKING_DIRECTORY $ COMMENT "Generating API documentation with Doxygen" VERBATIM ) add_custom_target(doc DEPENDS $/cpp) endif () endif (DOXYGEN_FOUND)  add_subdirectory (src) add_subdirectory (examples) 
0
Wie sieht Ihr CMakeLists.txt aus? Schauen Sie doch mal rein: https://cmake.org/cmake-tutorial/ duDE vor 7 Jahren 0
Ich habe meine CMakeLists.txt zur ursprünglichen Frage hinzugefügt. Colin747 vor 7 Jahren 0

2 Antworten auf die Frage

0
Colin747

Laufen:

brew install GLib

Behoben.

0
equal-l2

Nun, die Paketbenennungskonvention unterscheidet sich zwischen Brew und Unix Package Manager.

In Brew,

pkg-config=> gleicher Name
libvte-2.90-dev=> vteoder vte3
glib-2.0=>glib

Leider libgranite-dev, libindicator3-devund libkeybinder-3.0-devderzeit nicht über den entsprechenden Betrag in Gebräu.

(Ich denke, Ihr CMakeFile wird funktionieren, sobald glib installiert wurde.)