Это мой файл CMake (я не добавил часть Windows, чтобы было понятнее)
Код: Выделить всё
make_minimum_required(VERSION 3.19)
# Set the project name and C++ standard
project(Main)
set(CMAKE_CXX_STANDARD 17)
# Add the header file directory
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../src")
# Find the static library
set(SIMPROTOCOL_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../out/build/linux-release")
find_library(SIMPROTOCOL_LIB NAMES SimLib PATHS ${SIMPROTOCOL_LIB_DIR} NO_DEFAULT_PATH)
set(SOURCE_FILES main.cpp)
# Define the executable that is built from the source file
add_executable(Main${SOURCE_FILES})
target_link_libraries(Main PRIVATE ${SIMPROTOCOL_LIB})
Код: Выделить всё
[cmake] CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
[cmake] Please set them or make sure they are set and tested correctly in the CMake files:
[cmake] SIMPROTOCOL_LIB
- Он создается, когда я вызываю g++ с аргументами и всем, что указывает на файлы заголовков и статическая библиотека
- В моем пути есть пробелы, но я изменил путь к статической библиотеке на другой, без пробелов, и он не работает с CMake
- Да, я проверил путь к статической библиотеке, путь правильный
Заранее спасибо!
Подробнее здесь: https://stackoverflow.com/questions/783 ... fined-path
Мобильная версия