Я хочу импортировать библиотеки и тому подобное, но я не смог ничего импортировать и использовать что -либо ... Я скачал двоичные файлы для GLFW, скопировал папку «Включить» в корневую папку моего проекта Clion. А тогда что? Я должен связать это, но как? < /P>
Пока это ошибка, которую я получаю: < /p>
====================[ Build | LearnOpenGL | Debug ]=============================
"C:\Program Files\CMake\bin\cmake.exe" --build C:\dev\LearnOpenGL\cmake-build-debug --target LearnOpenGL -j 10
[0/1] Re-running CMake...
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:6 (find_package):
By not providing "FindGLFW.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "GLFW", but
CMake did not find one.
Could not find a package configuration file provided by "GLFW" with any of
the following names:
GLFWConfig.cmake
glfw-config.cmake
Add the installation prefix of "GLFW" to CMAKE_PREFIX_PATH or set
"GLFW_DIR" to a directory containing one of the above files. If "GLFW"
provides a separate development package or SDK, be sure it has been
installed.
ninja: error: rebuilding 'build.ninja': subcommand failed
-- Configuring incomplete, errors occurred!
FAILED: build.ninja
"C:\Program Files\CMake\bin\cmake.exe" --regenerate-during-build -SC:\dev\LearnOpenGL -BC:\dev\LearnOpenGL\cmake-build-debug
< /code>
Пока что мой cmakelists.txt выглядит так ... < /p>
cmake_minimum_required(VERSION 3.0)
project(LearnOpenGL)
set(CMAKE_CXX_STANDARD 23)
find_package(GLFW REQUIRED)
add_executable(LearnOpenGL main.cpp)
include_directories(./include)
target_link_libraries("${CMAKE_PROJECT_NAME}" PRIVATE glfw)
< /code>
Структура проекта - это нечто вроде: < /p>
Root
|-- include
| |-- GLFW
| | |-- glfw3.h
| | |-- glfwnative.h
|-- CMakeLists.txt
|-- main.cpp
< /code>
Но это не ссылка или что -то в этом роде ... не уверен. < /p>
Я попытался использовать CPM: < /p>
cmake_minimum_required(VERSION 3.0)
project(LearnOpenGL)
set(CMAKE_CXX_STANDARD 23)
add_executable(main main.cpp)
include(cmake/CPM.cmake)
CPMAddPackage("gh:glfw/glfw#3.4")
CPMAddPackage("gh:Dav1dde/glad#v2.0.6")
target_link_libraries(main glad glfw)
Я хочу импортировать библиотеки и тому подобное, но я не смог ничего импортировать и использовать что -либо ... Я скачал двоичные файлы для GLFW, скопировал папку «Включить» в корневую папку моего проекта Clion. А тогда что? Я должен связать это, но как? < /P> Пока это ошибка, которую я получаю: < /p> [code]====================[ Build | LearnOpenGL | Debug ]============================= "C:\Program Files\CMake\bin\cmake.exe" --build C:\dev\LearnOpenGL\cmake-build-debug --target LearnOpenGL -j 10 [0/1] Re-running CMake... CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake.
Update the VERSION argument value or use a ... suffix to tell CMake that the project does not need compatibility with older versions.
CMake Error at CMakeLists.txt:6 (find_package): By not providing "FindGLFW.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "GLFW", but CMake did not find one.
Could not find a package configuration file provided by "GLFW" with any of the following names:
GLFWConfig.cmake glfw-config.cmake
Add the installation prefix of "GLFW" to CMAKE_PREFIX_PATH or set "GLFW_DIR" to a directory containing one of the above files. If "GLFW" provides a separate development package or SDK, be sure it has been installed.
include_directories(./include) target_link_libraries("${CMAKE_PROJECT_NAME}" PRIVATE glfw) < /code> Структура проекта - это нечто вроде: < /p> Root |-- include | |-- GLFW | | |-- glfw3.h | | |-- glfwnative.h |-- CMakeLists.txt |-- main.cpp < /code> Но это не ссылка или что -то в этом роде ... не уверен. < /p> Я попытался использовать CPM: < /p> cmake_minimum_required(VERSION 3.0) project(LearnOpenGL)