Update OpenGL sample build settings on Windows

This commit is contained in:
Rob Armstrong 2025-02-10 23:10:55 -08:00
parent 9582bb03a9
commit 7a9bd38ecc
22 changed files with 517 additions and 30 deletions

View File

@ -17,6 +17,12 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -41,10 +47,26 @@ if(${OpenGL_FOUND})
${GLUT_INCLUDE_DIRS} ${GLUT_INCLUDE_DIRS}
) )
target_link_libraries(simpleCUDA2GL target_link_libraries(simpleCUDA2GL
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
if(WIN32)
target_link_libraries(simpleCUDA2GL
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET simpleCUDA2GL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET simpleCUDA2GL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
endif() endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'simpleCUDA2GL'") message(STATUS "GLUT not found - will not build sample 'simpleCUDA2GL'")

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for simpleTexture3D # Add target for simpleTexture3D
add_executable(simpleTexture3D simpleTexture3D_kernel.cu simpleTexture3D.cpp) add_executable(simpleTexture3D simpleTexture3D_kernel.cu simpleTexture3D.cpp)
target_compile_options(simpleTexture3D PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(simpleTexture3D PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(simpleTexture3D PRIVATE cxx_std_17 cuda_std_17) target_compile_features(simpleTexture3D PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(simpleTexture3D PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(simpleTexture3D PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -50,6 +55,23 @@ target_compile_features(simpleTexture3D PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
) )
if(WIN32)
target_link_libraries(simpleTexture3D
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET simpleTexture3D
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET simpleTexture3D
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'simpleTexture3D'") message(STATUS "GLUT not found - will not build sample 'simpleTexture3D'")
endif() endif()

View File

@ -17,6 +17,10 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -27,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for FunctionPointers # Add target for FunctionPointers
add_executable(FunctionPointers FunctionPointers.cpp FunctionPointers_kernels.cu) add_executable(FunctionPointers FunctionPointers.cpp FunctionPointers_kernels.cu)
target_compile_options(FunctionPointers PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(FunctionPointers PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(FunctionPointers PRIVATE cxx_std_17 cuda_std_17) target_compile_features(FunctionPointers PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(FunctionPointers PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(FunctionPointers PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -51,6 +55,23 @@ target_compile_features(FunctionPointers PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
) )
if(WIN32)
target_link_libraries(FunctionPointers
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET FunctionPointers
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET FunctionPointers
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'FunctionPointers'") message(STATUS "GLUT not found - will not build sample 'FunctionPointers'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -64,6 +69,23 @@ if(${OpenGL_FOUND})
${CMAKE_CURRENT_BINARY_DIR}/ ${CMAKE_CURRENT_BINARY_DIR}/
) )
if(WIN32)
target_link_libraries(boxFilter
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET boxFilter
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET boxFilter
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'boxFilter'") message(STATUS "GLUT not found - will not build sample 'boxFilter'")
endif() endif()

View File

@ -17,6 +17,12 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +32,9 @@ if(${OpenGL_FOUND})
# Add target for imageDenoising # Add target for imageDenoising
add_executable(imageDenoising bmploader.cpp imageDenoising.cu imageDenoisingGL.cpp) add_executable(imageDenoising bmploader.cpp imageDenoising.cu imageDenoisingGL.cpp)
target_compile_options(imageDenoising PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(imageDenoising PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(imageDenoising PRIVATE cxx_std_17 cuda_std_17) target_compile_features(imageDenoising PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(imageDenoising PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(imageDenoising PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -50,6 +56,23 @@ target_compile_features(imageDenoising PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(imageDenoising
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET imageDenoising
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET imageDenoising
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'imageDenoising'") message(STATUS "GLUT not found - will not build sample 'imageDenoising'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -50,6 +55,23 @@ target_compile_features(particles PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(particles
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET particles
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET particles
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'particles'") message(STATUS "GLUT not found - will not build sample 'particles'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -50,6 +55,23 @@ target_compile_features(bindlessTexture PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(bindlessTexture
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET bindlessTexture
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET bindlessTexture
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'bindlessTexture'") message(STATUS "GLUT not found - will not build sample 'bindlessTexture'")
endif() endif()

View File

@ -17,6 +17,12 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -51,6 +57,24 @@ target_compile_features(oceanFFT PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(oceanFFT
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET oceanFFT
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET oceanFFT
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'oceanFFT'") message(STATUS "GLUT not found - will not build sample 'oceanFFT'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for randomFog # Add target for randomFog
add_executable(randomFog randomFog.cpp rng.cpp) add_executable(randomFog randomFog.cpp rng.cpp)
target_compile_options(randomFog PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(randomFog PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(randomFog PRIVATE cxx_std_17 cuda_std_17) target_compile_features(randomFog PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(randomFog PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(randomFog PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -52,6 +57,23 @@ target_compile_features(randomFog PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(randomFog
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET randomFog
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET randomFog
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'randomFog'") message(STATUS "GLUT not found - will not build sample 'randomFog'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -50,6 +55,23 @@ target_compile_features(Mandelbrot PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(Mandelbrot
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET Mandelbrot
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET Mandelbrot
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'Mandelbrot'") message(STATUS "GLUT not found - will not build sample 'Mandelbrot'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for SobelFilter # Add target for SobelFilter
add_executable(SobelFilter SobelFilter.cpp SobelFilter_kernels.cu) add_executable(SobelFilter SobelFilter.cpp SobelFilter_kernels.cu)
target_compile_options(SobelFilter PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(SobelFilter PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(SobelFilter PRIVATE cxx_std_17 cuda_std_17) target_compile_features(SobelFilter PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(SobelFilter PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(SobelFilter PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -49,6 +54,23 @@ target_compile_features(SobelFilter PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(SobelFilter
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET SobelFilter
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET SobelFilter
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'SobelFilter'") message(STATUS "GLUT not found - will not build sample 'SobelFilter'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for bicubicTexture # Add target for bicubicTexture
add_executable(bicubicTexture bicubicTexture.cpp bicubicTexture_cuda.cu) add_executable(bicubicTexture bicubicTexture.cpp bicubicTexture_cuda.cu)
target_compile_options(bicubicTexture PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(bicubicTexture PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(bicubicTexture PRIVATE cxx_std_17 cuda_std_17) target_compile_features(bicubicTexture PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(bicubicTexture PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(bicubicTexture PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -50,6 +55,23 @@ target_compile_features(bicubicTexture PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(bicubicTexture
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET bicubicTexture
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET bicubicTexture
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'bicubicTexture'") message(STATUS "GLUT not found - will not build sample 'bicubicTexture'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -50,6 +55,24 @@ target_compile_features(bilateralFilter PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(bilateralFilter
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET bilateralFilter
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET bilateralFilter
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'bilateralFilter'") message(STATUS "GLUT not found - will not build sample 'bilateralFilter'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -51,6 +56,23 @@ target_compile_features(fluidsGL PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(fluidsGL
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET fluidsGL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET fluidsGL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'fluidsGL'") message(STATUS "GLUT not found - will not build sample 'fluidsGL'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -50,6 +55,23 @@ target_compile_features(marchingCubes PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(marchingCubes
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET marchingCubes
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET marchingCubes
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'marchingCubes'") message(STATUS "GLUT not found - will not build sample 'marchingCubes'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for nbody # Add target for nbody
add_executable(nbody bodysystemcuda.cu render_particles.cpp nbody.cpp) add_executable(nbody bodysystemcuda.cu render_particles.cpp nbody.cpp)
target_compile_options(nbody PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(nbody PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(nbody PRIVATE cxx_std_17 cuda_std_17) target_compile_features(nbody PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(nbody PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(nbody PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -43,6 +48,23 @@ target_compile_features(nbody PRIVATE cxx_std_17 cuda_std_17)
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
if(WIN32)
target_link_libraries(nbody
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET nbody
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET nbody
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'nbody'") message(STATUS "GLUT not found - will not build sample 'nbody'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for postProcessGL # Add target for postProcessGL
add_executable(postProcessGL main.cpp postProcessGL.cu) add_executable(postProcessGL main.cpp postProcessGL.cu)
target_compile_options(postProcessGL PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(postProcessGL PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(postProcessGL PRIVATE cxx_std_17 cuda_std_17) target_compile_features(postProcessGL PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(postProcessGL PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(postProcessGL PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -49,6 +54,23 @@ target_compile_features(postProcessGL PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(postProcessGL
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET postProcessGL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET postProcessGL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'postProcessGL'") message(STATUS "GLUT not found - will not build sample 'postProcessGL'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for recursiveGaussian # Add target for recursiveGaussian
add_executable(recursiveGaussian recursiveGaussian_cuda.cu recursiveGaussian.cpp) add_executable(recursiveGaussian recursiveGaussian_cuda.cu recursiveGaussian.cpp)
target_compile_options(recursiveGaussian PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(recursiveGaussian PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(recursiveGaussian PRIVATE cxx_std_17 cuda_std_17) target_compile_features(recursiveGaussian PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(recursiveGaussian PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(recursiveGaussian PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -49,6 +54,23 @@ target_compile_features(recursiveGaussian PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(recursiveGaussian
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET recursiveGaussian
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET recursiveGaussian
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'recursiveGaussian'") message(STATUS "GLUT not found - will not build sample 'recursiveGaussian'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for simpleGL # Add target for simpleGL
add_executable(simpleGL simpleGL.cu) add_executable(simpleGL simpleGL.cu)
target_compile_options(simpleGL PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(simpleGL PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(simpleGL PRIVATE cxx_std_17 cuda_std_17) target_compile_features(simpleGL PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(simpleGL PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(simpleGL PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -43,6 +48,23 @@ target_compile_features(simpleGL PRIVATE cxx_std_17 cuda_std_17)
${GLUT_LIBRARIES} ${GLUT_LIBRARIES}
) )
if(WIN32)
target_link_libraries(simpleGL
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET simpleGL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET simpleGL
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
add_custom_command(TARGET simpleGL POST_BUILD add_custom_command(TARGET simpleGL POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_SOURCE_DIR}/data

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for smokeParticles # Add target for smokeParticles
add_executable(smokeParticles GLSLProgram.cpp ParticleSystem.cpp ParticleSystem_cuda.cu SmokeRenderer.cpp SmokeShaders.cpp framebufferObject.cpp particleDemo.cpp renderbuffer.cpp) add_executable(smokeParticles GLSLProgram.cpp ParticleSystem.cpp ParticleSystem_cuda.cu SmokeRenderer.cpp SmokeShaders.cpp framebufferObject.cpp particleDemo.cpp renderbuffer.cpp)
target_compile_options(smokeParticles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(smokeParticles PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(smokeParticles PRIVATE cxx_std_17 cuda_std_17) target_compile_features(smokeParticles PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(smokeParticles PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(smokeParticles PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -49,6 +54,23 @@ target_compile_features(smokeParticles PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(smokeParticles
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET smokeParticles
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET smokeParticles
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'smokeParticles'") message(STATUS "GLUT not found - will not build sample 'smokeParticles'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for volumeFiltering # Add target for volumeFiltering
add_executable(volumeFiltering volume.cpp volumeFilter_kernel.cu volumeFiltering.cpp volumeRender_kernel.cu) add_executable(volumeFiltering volume.cpp volumeFilter_kernel.cu volumeFiltering.cpp volumeRender_kernel.cu)
target_compile_options(volumeFiltering PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(volumeFiltering PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(volumeFiltering PRIVATE cxx_std_17 cuda_std_17) target_compile_features(volumeFiltering PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(volumeFiltering PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(volumeFiltering PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -49,6 +54,23 @@ target_compile_features(volumeFiltering PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(volumeFiltering
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET volumeFiltering
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET volumeFiltering
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'volumeFiltering'") message(STATUS "GLUT not found - will not build sample 'volumeFiltering'")
endif() endif()

View File

@ -17,6 +17,11 @@ endif()
# Include directories and libraries # Include directories and libraries
include_directories(../../../Common) 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")
endif()
find_package(OpenGL) find_package(OpenGL)
find_package(GLUT) find_package(GLUT)
@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
# Add target for volumeRender # Add target for volumeRender
add_executable(volumeRender volumeRender_kernel.cu volumeRender.cpp) add_executable(volumeRender volumeRender_kernel.cu volumeRender.cpp)
target_compile_options(volumeRender PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>) target_compile_options(volumeRender PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(volumeRender PRIVATE cxx_std_17 cuda_std_17) target_compile_features(volumeRender PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(volumeRender PROPERTIES CUDA_SEPARABLE_COMPILATION ON) set_target_properties(volumeRender PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
@ -49,6 +54,23 @@ target_compile_features(volumeRender PRIVATE cxx_std_17 cuda_std_17)
${CMAKE_CURRENT_BINARY_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
) )
if(WIN32)
target_link_libraries(volumeRender
${PC_GLUT_LIBRARY_DIRS}/freeglut.lib
${PC_GLUT_LIBRARY_DIRS}/glew64.lib
)
add_custom_command(TARGET volumeRender
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/freeglut.dll ${CMAKE_CURRENT_BINARY_DIR}
)
add_custom_command(TARGET volumeRender
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/../../../bin/win64/$<CONFIGURATION>/glew64.dll ${CMAKE_CURRENT_BINARY_DIR}
)
endif()
else() else()
message(STATUS "GLUT not found - will not build sample 'volumeRender'") message(STATUS "GLUT not found - will not build sample 'volumeRender'")
endif() endif()