代码拉取完成,页面将自动刷新
cmake_minimum_required( VERSION 3.10.0 )
project( opengl-proj )
file(TO_NATIVE_PATH "${CMAKE_BINARY_DIR}/shader" DST_DIR)
file(TO_NATIVE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/shader" SRC_DIR)
if(MSVC)
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${DST_DIR})
execute_process(COMMAND cmd /C mklink /J ${DST_DIR} ${SRC_DIR})
elseif()
execute_process(COMMAND ${CMAKE_COMMAND} -E remove_directory ${DST_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_DIR} ${DST_DIR})
endif()
# external glfw
set( GLFW_BUILD_DOCS OFF CACHE INTERNAL "" )
set( GLFW_BUILD_TESTS OFF CACHE INTERNAL "" )
set( GLFW_BUILD_EXAMPLES OFF CACHE INTERNAL "" )
add_subdirectory( external/glfw )
add_subdirectory( external/glew )
# external includes
include_directories( external/glm )
include_directories( external/glad/include )
include_directories( external/glew/include )
# application code
include_directories( "include" )
add_executable(
opengl-proj
"src/main.cpp"
"external/glad/src/glad.c" )
target_compile_features(
opengl-proj
PUBLIC cxx_std_11 )
target_link_libraries(
opengl-proj
PRIVATE glfw
PRIVATE libglew_static )
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。