diff --git a/CMakeLists.txt b/CMakeLists.txt index 034e560..14472cc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,11 @@ add_library(QGLViewer SHARED ${QGLViewer_SRC}) target_include_directories(QGLViewer INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(QGLViewer PRIVATE ${QtLibs} OpenGL::GL OpenGL::GLU) +if(MSVC) + # Avoid a compiler error when using std::min/std::max. + target_compile_definitions(QGLViewer PRIVATE NOMINMAX) +endif() + # Example: animation. set(animation_SRC "${PROJECT_SOURCE_DIR}/examples/animation/animation.cpp"