愿天下没有难配置的opengl
-
一个通用的cmake文件
cmake_minimum_required(VERSION 2.8) project(lab7) # 设置FreeGLUT和GLM的路径 set(GLUT_INCLUDE_DIR "F:/chaojiliangzai/univer_canterbury_raytrace/freeglut-3.4.0.tar/freeglut-3.4.0/include") set(GLUT_LIBRARY_DIR "F:/chaojiliangzai/univer_canterbury_raytrace/freeglut-3.4.0.tar/freeglut-3.4.0/build/lib/Debug") set(GLM_INCLUDE_DIR "E:/01_study/SimpleClothSim-main") # 添加头文件路径 include_directories(${GLUT_INCLUDE_DIR} ${GLM_INCLUDE_DIR}) # 设置库文件路径 link_directories(${GLUT_LIBRARY_DIR}) # 添加可执行文件 add_executable(RayTracer.out RayTracer.cpp Ray.cpp SceneObject.cpp Sphere.cpp) # 找到OpenGL和FreeGLUT find_package(OpenGL REQUIRED) find_package(FreeGLUT REQUIRED) # 链接库 target_link_libraries(RayTracer.out ${OPENGL_LIBRARIES} ${GLUT_LIBRARY}) # cmake -G "Visual Studio 16 2019"
-
怎样编译freeLUT
mkdir build cd build cmake .. -G "Visual Studio 16 2019" cmake --build . cmake --install . # 修改debug/release,默认build debug,所以需要release cmake --build . --config Release # 修改install,默认是install release版本,所以需要弄成Debug cmake --install . --config Debug # 修改sln,vcproj的项目的架构 cmake .. -G "Visual Studio 16 2019" -A win32/x64
-
freeLut install到哪里了?
cmake --install . --config Debug -- Installing: C:/Program Files (x86)/freeglut/lib/freeglutd.lib -- Installing: C:/Program Files (x86)/freeglut/bin/freeglutd.dll -- Installing: C:/Program Files (x86)/freeglut/bin/freeglutd.pdb -- Installing: C:/Program Files (x86)/freeglut/lib/freeglut_staticd.lib -- Up-to-date: C:/Program Files (x86)/freeglut/include/GL/freeglut.h -- Up-to-date: C:/Program Files (x86)/freeglut/include/GL/freeglut_ucall.h -- Up-to-date: C:/Program Files (x86)/freeglut/include/GL/freeglut_ext.h -- Up-to-date: C:/Program Files (x86)/freeglut/include/GL/freeglut_std.h -- Up-to-date: C:/Program Files (x86)/freeglut/lib/pkgconfig/freeglut.pc -- Up-to-date: C:/Program Files (x86)/freeglut/lib/cmake/FreeGLUT/FreeGLUTTargets.cmake -- Installing: C:/Program Files (x86)/freeglut/lib/cmake/FreeGLUT/FreeGLUTTargets-debug.cmake -- Up-to-date: C:/Program Files (x86)/freeglut/lib/cmake/FreeGLUT/FreeGLUTConfig.cmake -- Up-to-date: C:/Program Files (x86)/freeglut/lib/cmake/FreeGLUT/FreeGLUTConfigVersion.cmake
freelut和glm的下载:链接:https://pan.baidu.com/s/13dTO2MJQs_Q7qkL4j7Ferg
提取码:1122
--来自百度网盘超级会员V6的分享