У меня есть проблема с использованием библиотек для C ++ с использованием CONAN2 и CMAKE в Linux. Файлы: < /p>
cmakelist.txt in root: < /p>
cmake_minimum_required(VERSION 3.5)
set(CMAKE_CXX_COMPILER "/usr/bin/clang++")
# set(CMAKE_CXX_COMPILER "/usr/bin/g++-14")
project(exercises
VERSION 1.0
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_COMPILE_WARNING_AS_ERROR)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_BUILD_TYPE Debug) # TODO change type to Release for build commitment
option (FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)."
TRUE)
if (${FORCE_COLORED_OUTPUT})
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options (-fdiagnostics-color=always)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
endif ()
endif ()
enable_testing()
include_directories(includes)
add_subdirectory(src)
add_subdirectory(tests)
target_compile_options(main PRIVATE -fopenmp -g -ggdb -Werror -Wall -pedantic
# -Wno-parentheses
-Wnull-dereference -Wextra -Wshadow -Wnon-virtual-dtor
# -ftime-report) # to get detailed compilation timer
-finput-charset=UTF-8 )# enable UTF-8 support for GCC
< /code>
cmakelist.txt в src dir: < /p>
find_package(LibtorrentRasterbar REQUIRED)
include_directories(${LibtorrentRasterbar_INCLUDE_DIRS})
add_executable(main main_new.cpp )
target_link_libraries(main PRIVATE
LibtorrentRasterbar::torrent-rasterbar)
< /code>
main.cpp
#include
#include
#include
#include
#include
using namespace libtorrent;
int main() {
session s;
std::string torrent_file = "../../test_folder-d984f67af9917b214cd8b6048ab5624c7df6a07a.torrent";
try {
torrent_info info(torrent_file);
add_torrent_params p;
p.ti = std::make_shared(info);
p.save_path = "./";
torrent_handle h = s.add_torrent(p);
std::cout
Подробнее здесь: https://stackoverflow.com/questions/795 ... e-projects
Не удалось найти *config.cmake в нескольких проектах C ++ Cmake ⇐ C++
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Ошибка: не удалось получить config от http: // localhost: 8080/api/config [закрыто]
Anonymous » » в форуме MySql - 0 Ответы
- 2 Просмотры
-
Последнее сообщение Anonymous
-