Ich bin jetzt seit einer Weile fest und ich kann nicht herausfinden, wie Freeglut funktioniert. Ich dachte, ich wüsste, was ich von mir verlangte, also habe ich diese Zeile (prefix_path) hinzugefügt, aber es hat nichts bewirkt. Soll ich meine eigene freeglut-config.cmake schreiben oder was?CMake kann Freeglut nicht auf Windows in Clion finden
Hinweis: Ich bin mit dem freeglut für MinGW Paket von dieser website
CMake Datei:
cmake_minimum_required(VERSION 3.7)
project(HW1)
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES Triangle.cpp)
set(CMAKE_PREFIX_PATH "C:/freeglut")
find_package(GLEW REQUIRED STATIC)
find_package(FREEGLUT REQUIRED)
find_package(OPENGL REQUIRED)
include_directories(${FREEGLUT_INCLUDE_DIRS} ${GLEW_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS})
link_directories(${FREEGLUT_LIBRARY_DIRS} ${GLEW_LIBRARY_DIRS} ${OPENGL_LIBRARY_DIRS})
add_definitions(${FREEGLUT_DEFINITIONS} ${GLEW_DEFINITIONS} ${OPENGL_DEFINITIONS})
add_executable(HW1 ${SOURCE_FILES})
target_link_libraries(HW1 ${FREEGLUT_LIBRARIES} ${GLEW_LIBRARIES} ${OPENGL_LIBRARIES})
Voll Fehler:
CMake Error at CMakeLists.txt:8 (find_package):
By not providing "FindFREEGLUT.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "FREEGLUT",
but CMake did not find one.
Could not find a package configuration file provided by "FREEGLUT" with any
of the following names:
FREEGLUTConfig.cmake
freeglut-config.cmake
Add the installation prefix of "FREEGLUT" to CMAKE_PREFIX_PATH or set
"FREEGLUT_DIR" to a directory containing one of the above files. If
"FREEGLUT" provides a separate development package or SDK, be sure it has
been installed.
Ich bin nicht sicher, dass das geholfen hat, jetzt bekomme ich einen anderen Fehler: https://hastebin.com/cuzohiwada.vbs. Ich benutze diese Jungs find.cmake https://github.com/PDAL/PDAL/blob/master/cmake/modules/FindFreeGLUT.cmake – lbenedetto
aussehen wie Ihre Bibliotheken sind ** inkompatibel ** mit MinGW. Beachten Sie, dass es nicht definierte Verweise auf glew-Funktionen gibt, die nicht mit GLUT oder freeglut verwandt sind. – Tsyvarev
Also die bereitgestellten Windows-Binärdateien (http://glew.sourceforge.net/) wird nicht funktionieren? Ich muss meine eigene Quelle kompilieren? – lbenedetto