mirror of
https://github.com/NVIDIA/cuda-samples.git
synced 2026-10-25 22:28:17 +08:00
Update OpenGL sample build settings on Windows
This commit is contained in:
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -50,6 +55,23 @@ target_compile_features(Mandelbrot PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'Mandelbrot'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for SobelFilter
|
||||
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)
|
||||
|
||||
@@ -49,6 +54,23 @@ target_compile_features(SobelFilter PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'SobelFilter'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for bicubicTexture
|
||||
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)
|
||||
|
||||
@@ -50,6 +55,23 @@ target_compile_features(bicubicTexture PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'bicubicTexture'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -50,6 +55,24 @@ target_compile_features(bilateralFilter PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'bilateralFilter'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -51,6 +56,23 @@ target_compile_features(fluidsGL PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'fluidsGL'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -50,6 +55,23 @@ target_compile_features(marchingCubes PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'marchingCubes'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for nbody
|
||||
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)
|
||||
|
||||
@@ -43,6 +48,23 @@ target_compile_features(nbody PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'nbody'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for postProcessGL
|
||||
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)
|
||||
|
||||
@@ -49,6 +54,23 @@ target_compile_features(postProcessGL PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'postProcessGL'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for recursiveGaussian
|
||||
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)
|
||||
|
||||
@@ -49,6 +54,23 @@ target_compile_features(recursiveGaussian PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'recursiveGaussian'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for simpleGL
|
||||
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)
|
||||
|
||||
@@ -43,6 +48,23 @@ target_compile_features(simpleGL PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/data
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for smokeParticles
|
||||
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)
|
||||
|
||||
@@ -49,6 +54,23 @@ target_compile_features(smokeParticles PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'smokeParticles'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for volumeFiltering
|
||||
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)
|
||||
|
||||
@@ -49,6 +54,23 @@ target_compile_features(volumeFiltering PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'volumeFiltering'")
|
||||
endif()
|
||||
|
||||
@@ -17,6 +17,11 @@ endif()
|
||||
# Include directories and libraries
|
||||
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(GLUT)
|
||||
|
||||
@@ -26,9 +31,9 @@ if(${OpenGL_FOUND})
|
||||
# Add target for volumeRender
|
||||
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)
|
||||
|
||||
@@ -49,6 +54,23 @@ target_compile_features(volumeRender PRIVATE cxx_std_17 cuda_std_17)
|
||||
${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()
|
||||
message(STATUS "GLUT not found - will not build sample 'volumeRender'")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user