Содержимое файла CMakeLists.txt, в который входит код:
Код: Выделить всё
cmake_minimum_required(VERSION 3.21)
project( C CXX)
set(CMAKE_CXX_STANDARD 23)
add_executable( src/main.cpp
src/.h
src/.h src/.cpp
src/.h
src/.h src/.cpp
src/.h src/.cpp
src/.h
src/.h src/.c
src/.h)
find_package(PkgConfig REQUIRED)
pkg_search_module(GLIB REQUIRED glib-2.0)
include_directories(${GLIB_INCLUDE_DIRS})
link_directories(${GLIB_LIBRARY_DIRS})
target_link_libraries( ${GLIB_LIBRARIES} gcrypt)
Код: Выделить всё
-- Found PkgConfig: C:/Users/Jonathon/Downloads/pkg-config-lite-0.28-1_bin-win32/pkg-config-lite-0.28-1/bin/pkg-config.exe (found version "0.28")
-- Checking for module 'glib-2.0'
-- No package 'glib-2.0' found
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:634 (message):
The following required packages were not found:
- glib-2.0
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:862 (_pkg_check_modules_internal)
CMakeLists.txt:28 (PKG_CHECK_MODULES)
-- Configuring incomplete, errors occurred!
Буду очень признателен за любую помощь. Спасибо
[Обновление]
Я попробовал установить glib с помощью conan, используя это как conanfile.txt:
Код: Выделить всё
[requires]
glib/2.78.3
[generators]
CMakeDeps
CMakeToolchain
Код: Выделить всё
======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
======== Computing dependency graph ========
Graph root
conanfile.txt: C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\conanfile.txt
Requirements
bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01 - Cache
libffi/3.4.4#35eb63842b505824b70aedc1baefc916 - Cache
libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b - Cache
libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache
pcre2/10.42#a7a2c122056510509a7525c83d6a6695 - Cache
zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
autoconf/2.71#f9307992909d7fb3df459340f1932809 - Cache
automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50 - Cache
m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache
meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache
msys2/cci.latest#5a31efa2bde593541fd5ac3bcc50c01c - Cache
ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache
pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
Resolved version ranges
zlib/[>=1.2.11 =3.23
conanfile.txt: If your CMake version is not compatible with CMakePresets (=1.2.11 =3.23
conanfile.txt: If your CMake version is not compatible with CMakePresets (cd ..
C:\Users\Jonathon\source\tlsdump-main\tlsdump-main>conan install . --output-folder=build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake && cmake --build
======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=14
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
======== Computing dependency graph ========
Graph root
conanfile.txt: C:\Users\Jonathon\source\tlsdump-main\tlsdump-main\conanfile.txt
Requirements
bzip2/1.0.8#457c272f7da34cb9c67456dd217d36c4 - Cache
glib/2.78.3#0cd1865c8603d90b3bc5858065e16d01 - Cache
libffi/3.4.4#35eb63842b505824b70aedc1baefc916 - Cache
libgettext/0.22#2c87563d7a69544dd9379f038aca3b0b - Cache
libiconv/1.17#73fefc1b696e069df90fd1d18aa63edd - Cache
pcre2/10.42#a7a2c122056510509a7525c83d6a6695 - Cache
zlib/1.3.1#f52e03ae3d251dec704634230cd806a2 - Cache
Build requirements
autoconf/2.71#f9307992909d7fb3df459340f1932809 - Cache
automake/1.16.5#058bda3e21c36c9aa8425daf3c1faf50 - Cache
m4/1.4.19#b38ced39a01e31fef5435bc634461fd2 - Cache
meson/1.2.2#04bdfb85d665c82b08a3510aee3ffd19 - Cache
msys2/cci.latest#5a31efa2bde593541fd5ac3bcc50c01c - Cache
ninja/1.11.1#77587f8c8318662ac8e5a7867eb4be21 - Cache
pkgconf/2.0.3#f996677e96e61e6552d85e83756c328b - Cache
Resolved version ranges
zlib/[>=1.2.11 =3.23
conanfile.txt: If your CMake version is not compatible with CMakePresets (
Подробнее здесь: [url]https://stackoverflow.com/questions/78398442/pkgconfig-cant-find-glib-2-0-when-trying-to-build-with-cmake[/url]