Код: Выделить всё
CMake Error at CMakeLists.txt:61 (target_link_libraries):
Target "tgpost1" links to:
TgBot::TgBot
but the target was not found.
Я думал, что общее правило всегда было project_name :: target_name? Почему толстая кишка работает с некоторыми, но не с другими?
Код: Выделить всё
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json
GIT_TAG v3.11.3
GIT_SHALLOW TRUE)
FetchContent_Declare(
TgBot
GIT_REPOSITORY https://github.com/reo7sp/tgbot-cpp
GIT_TAG v1.8
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(TgBot)
FetchContent_MakeAvailable(nlohmann_json)
add_executable(tgpost1 tgpost1.cpp)
target_include_directories(tgpost1 PUBLIC ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(tgpost1 PUBLIC TgBot::TgBot)
target_link_libraries(tgpost1 PUBLIC nlohmann_json::nlohmann_json)
Подробнее здесь: https://stackoverflow.com/questions/794 ... tchcontent