Wie kann ich GLFW in einem neuen Clion -Projekt hinzufügen?C++

Programme in C++. Entwicklerforum
Anonymous
 Wie kann ich GLFW in einem neuen Clion -Projekt hinzufügen?

Post by Anonymous »

Ich möchte Libraires und dergleichen importieren, aber ich konnte bisher nichts importieren und verwenden ... Ich habe die Binärdateien für GLFW heruntergeladen und den Ordner des Include -Ordners in den Root -Ordner meines Clion -Projekts kopiert. Und was dann? Ich soll es verknüpfen, aber wie?

Code: Select all

====================[ 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>
Bisher sieht meine cmakelists.txt so aus ... < /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>
Projektstruktur ist so etwas wie: < /p>
Root
|-- include
|  |-- GLFW
|  |  |-- glfw3.h
|  |  |-- glfwnative.h
|-- CMakeLists.txt
|-- main.cpp
< /code>
Aber es ist nicht verlinkt oder so ... nicht sicher.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)
Aber jetzt ist es froh, dass das überhaupt nicht arbeiten möchte ...

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post
  • OpenMP unter MacOS für ein C++ CLion-Projekt
    by Guest » » in C++
    0 Replies
    8 Views
    Last post by Guest
  • Wie verwende ich Clion Tip Kommentarstil -Dokumentation?
    by Anonymous » » in C++
    0 Replies
    9 Views
    Last post by Anonymous
  • Wie übertrage ich ein Array von Strukturen von glfw c++ nach glsl? [geschlossen]
    by Guest » » in C++
    0 Replies
    26 Views
    Last post by Guest
  • Die Textur ist in Apple Metal / GLFW / C ++ verschwommen
    by Anonymous » » in C++
    0 Replies
    16 Views
    Last post by Anonymous
  • Die Textur ist in Apple Metal / GLFW / C ++ verschwommen
    by Anonymous » » in C++
    0 Replies
    20 Views
    Last post by Anonymous