Bug 5376426: Update README and CMakeLists.txt for freeglut and glew on WOA

This commit is contained in:
shawnz
2025-07-11 10:50:57 +08:00
parent 1a35902577
commit 555353b4b5
22 changed files with 178 additions and 43 deletions

View File

@@ -22,6 +22,12 @@ include_directories(../../../Common)
if(WIN32)
set(PC_GLUT_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../../../Common")
set(PC_GLUT_LIBRARY_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../../../Common/lib/x64")
# The GLEW library built on Windows on Arm system is named as glew32.lib/glew32.dll by default.
if(EXISTS "${PC_GLUT_LIBRARY_DIRS}/glew32.lib")
set(GLEW_LIB_NAME "glew32")
else()
set(GLEW_LIB_NAME "glew64")
endif()
endif()
@@ -56,7 +62,7 @@ if(${OpenGL_FOUND})
if(WIN32)
target_link_libraries(simpleCUDA2GL
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
${PC_GLUT_LIBRARY_DIRS}/${GLEW_LIB_NAME}.lib
)
add_custom_command(TARGET simpleCUDA2GL
@@ -69,7 +75,7 @@ if(${OpenGL_FOUND})
add_custom_command(TARGET simpleCUDA2GL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll
copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/${GLEW_LIB_NAME}.dll
${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>
)
endif()