代码拉取完成,页面将自动刷新
cmake_minimum_required(VERSION 3.0.0)
project(MyRenderer VERSION 0.1.0)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
set(CMAKE_CXX_STANDARD 17)
file(GLOB_RECURSE SOURCE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp)
file(GLOB_RECURSE HEADER_FILE ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
file(COPY ${HEADER_FILE} DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include)
if(NOT TARGET spdlog)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/spdlog)
endif()
if(NOT TARGET glfw)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/glfw)
endif()
if(NOT TARGET glad)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/glad)
endif()
if(NOT TARGET imgui)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/ImGui.cmake)
endif()
if(NOT TARGET glm)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/glm)
endif()
if(NOT TARGET stb_image)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/stb_image)
endif()
if(NOT TARGET assimp)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/assimp)
endif()
set(INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/spdlog/include
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/glfw/include
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/glad/include
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/ImGui
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/glm/glm
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/stb_image
${CMAKE_CURRENT_SOURCE_DIR}/3rdParty/assimp/include
)
add_executable(${PROJECT_NAME} ${SOURCE_FILE} ${HEADER_FILE})
include_directories(${INCLUDE_DIRS})
target_include_directories(${PROJECT_NAME} PUBLIC ${INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} spdlog glfw glad imgui glm stb_image assimp)
########
# TEST #
########
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。